aboutsummaryrefslogtreecommitdiffstats
path: root/Frameworks/SPMySQLFramework/SPMySQL Unit Tests
diff options
context:
space:
mode:
authorMax <post@wickenrode.com>2015-10-04 14:39:34 +0200
committerMax <post@wickenrode.com>2015-10-04 14:39:34 +0200
commit05f9533860eb53e5fd0028cda74f9b6d7b26454d (patch)
tree76f3ffc5faade9b8b2357d437e85c63fa05e4ae1 /Frameworks/SPMySQLFramework/SPMySQL Unit Tests
parent0263046930b420e07c312c6fbe0156a4a1ebcdf0 (diff)
downloadsequelpro-05f9533860eb53e5fd0028cda74f9b6d7b26454d.tar.gz
sequelpro-05f9533860eb53e5fd0028cda74f9b6d7b26454d.tar.bz2
sequelpro-05f9533860eb53e5fd0028cda74f9b6d7b26454d.zip
Configure SPMySQL project to actually be able to run Unit Tests
* Add a new configuration "Unit Tests" * Add a new Target for the Unit Test code * Assign Unit Test Target to the Test step of SPMySQL scheme * Also remove a compiler setting for PowerMac G5
Diffstat (limited to 'Frameworks/SPMySQLFramework/SPMySQL Unit Tests')
-rw-r--r--Frameworks/SPMySQLFramework/SPMySQL Unit Tests/DataConversion_Tests.m12
-rw-r--r--Frameworks/SPMySQLFramework/SPMySQL Unit Tests/Info.plist24
2 files changed, 33 insertions, 3 deletions
diff --git a/Frameworks/SPMySQLFramework/SPMySQL Unit Tests/DataConversion_Tests.m b/Frameworks/SPMySQLFramework/SPMySQL Unit Tests/DataConversion_Tests.m
index 385eb0b2..b8256a5c 100644
--- a/Frameworks/SPMySQLFramework/SPMySQL Unit Tests/DataConversion_Tests.m
+++ b/Frameworks/SPMySQLFramework/SPMySQL Unit Tests/DataConversion_Tests.m
@@ -28,6 +28,12 @@
//
// More info at <https://github.com/sequelpro/sequelpro>
+#import <Cocoa/Cocoa.h>
+#import <XCTest/XCTest.h>
+
+// this function is inaccessible outside of unit tests
+extern NSString * _bitStringWithBytes(const char *bytes, NSUInteger length, NSUInteger padLength);
+
@interface DataConversion_Tests : XCTestCase
- (void)test_bitStringWithBytes;
@@ -40,10 +46,10 @@
{
// BIT(1)
{
- unsigned char y = 1;
- unsigned char n = 0;
+ const char y = '\1';
+ const char n = '\0';
XCTAssertEqualObjects(_bitStringWithBytes(&y,sizeof(y),1), @"1");
- XCTAssertEqualObjects(_bitStringWithBytes(&n,sizeof(n),0), @"0");
+ XCTAssertEqualObjects(_bitStringWithBytes(&n,sizeof(n),1), @"0");
}
// BIT(3)
{
diff --git a/Frameworks/SPMySQLFramework/SPMySQL Unit Tests/Info.plist b/Frameworks/SPMySQLFramework/SPMySQL Unit Tests/Info.plist
new file mode 100644
index 00000000..38544a84
--- /dev/null
+++ b/Frameworks/SPMySQLFramework/SPMySQL Unit 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>com.sequelpro.spmysql-unittests</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>