summaryrefslogtreecommitdiffstats
path: root/macosx/HandBrake Tests
diff options
context:
space:
mode:
authorritsuka <[email protected]>2015-05-20 19:25:36 +0000
committerritsuka <[email protected]>2015-05-20 19:25:36 +0000
commite5425e2befcf55a9ef97036fde585f5b35cef72b (patch)
treec8196fd2baca917001423606f927d34c6f3f7134 /macosx/HandBrake Tests
parent35cb55b6f77e21841fd46b666adc1888fcc81854 (diff)
MacGui: add a test target to the Xcode project, plus some simple test. Use a forward declaration instead of a #import to in HBJob to allow testing to work.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7214 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx/HandBrake Tests')
-rw-r--r--macosx/HandBrake Tests/HBJobTests.m42
-rw-r--r--macosx/HandBrake Tests/HBPresetsTests.m51
-rw-r--r--macosx/HandBrake Tests/Info.plist24
3 files changed, 117 insertions, 0 deletions
diff --git a/macosx/HandBrake Tests/HBJobTests.m b/macosx/HandBrake Tests/HBJobTests.m
new file mode 100644
index 000000000..e12f3ef10
--- /dev/null
+++ b/macosx/HandBrake Tests/HBJobTests.m
@@ -0,0 +1,42 @@
+/* HBJobTests.m $
+
+ This file is part of the HandBrake source code.
+ Homepage: <http://handbrake.fr/>.
+ It may be used under the terms of the GNU General Public License. */
+
+#import <Cocoa/Cocoa.h>
+#import <XCTest/XCTest.h>
+
+#import "HBJob.h"
+#import "HBPresetsManager.h"
+#import "HBPreset.h"
+
+@interface HBJobTests : XCTestCase
+
+@property (nonatomic, readonly) HBPresetsManager *manager;
+
+@end
+
+@implementation HBJobTests
+
+- (void)setUp {
+ [super setUp];
+
+ _manager = [[HBPresetsManager alloc] init];
+ [_manager generateBuiltInPresets];
+
+ // Put setup code here. This method is called before the invocation of each test method in the class.
+}
+
+- (void)tearDown {
+ // Put teardown code here. This method is called after the invocation of each test method in the class.
+ [super tearDown];
+}
+
+- (void)testJobCreation {
+ HBJob *job = [[HBJob alloc] init];
+
+ XCTAssert(job, @"Pass");
+}
+
+@end
diff --git a/macosx/HandBrake Tests/HBPresetsTests.m b/macosx/HandBrake Tests/HBPresetsTests.m
new file mode 100644
index 000000000..aff566911
--- /dev/null
+++ b/macosx/HandBrake Tests/HBPresetsTests.m
@@ -0,0 +1,51 @@
+/* HBPresetsTests.m $
+
+ This file is part of the HandBrake source code.
+ Homepage: <http://handbrake.fr/>.
+ It may be used under the terms of the GNU General Public License. */
+
+#import <Cocoa/Cocoa.h>
+#import <XCTest/XCTest.h>
+
+#import "HBPreset.h"
+#import "HBPresetsManager.h"
+
+@interface HBPresetsTests : XCTestCase
+
+@end
+
+@implementation HBPresetsTests
+
+- (void)setUp {
+ [super setUp];
+ // Put setup code here. This method is called before the invocation of each test method in the class.
+}
+
+- (void)tearDown {
+ // Put teardown code here. This method is called after the invocation of each test method in the class.
+ [super tearDown];
+}
+
+- (void)testManagerCreation {
+ HBPresetsManager *manager = [[HBPresetsManager alloc] init];
+
+ XCTAssert(manager, @"Pass");
+}
+
+- (void)testDefaultPresets {
+ HBPresetsManager *manager = [[HBPresetsManager alloc] init];
+ [manager generateBuiltInPresets];
+
+ XCTAssert(manager.root.children.count > 1, @"Pass");
+}
+
+- (void)testCreationTime {
+ HBPresetsManager *manager = [[HBPresetsManager alloc] init];
+
+ [self measureBlock:^{
+ [manager generateBuiltInPresets];
+
+ }];
+}
+
+@end
diff --git a/macosx/HandBrake Tests/Info.plist b/macosx/HandBrake Tests/Info.plist
new file mode 100644
index 000000000..ede3719bd
--- /dev/null
+++ b/macosx/HandBrake Tests/Info.plist
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleExecutable</key>
+ <string>$(EXECUTABLE_NAME)</string>
+ <key>CFBundleIdentifier</key>
+ <string>HB.$(PRODUCT_NAME:rfc1034identifier)</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>$(PRODUCT_NAME)</string>
+ <key>CFBundlePackageType</key>
+ <string>BNDL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+</dict>
+</plist>