aboutsummaryrefslogtreecommitdiff
path: root/UnitTesting
diff options
context:
space:
mode:
authorGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2014-03-10 15:30:06 +0000
committerGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2014-03-10 15:30:06 +0000
commit6bf30a3145af5ec7f4252d2d4faf0e7e9f3574c9 (patch)
tree4551426692a495cd2dbb34300fa434a23348cd53 /UnitTesting
parentcfe2827ce3ab3bef39bdea6e168ee9d577fb7974 (diff)
Updating GTM test files to build for x86_64
DELTA=12 (6 added, 0 deleted, 6 changed)
Diffstat (limited to 'UnitTesting')
-rw-r--r--UnitTesting/GTMIPhoneUnitTestDelegate.m14
-rw-r--r--UnitTesting/GTMSenTestCase.m4
2 files changed, 12 insertions, 6 deletions
diff --git a/UnitTesting/GTMIPhoneUnitTestDelegate.m b/UnitTesting/GTMIPhoneUnitTestDelegate.m
index 0318073..03ded2f 100644
--- a/UnitTesting/GTMIPhoneUnitTestDelegate.m
+++ b/UnitTesting/GTMIPhoneUnitTestDelegate.m
@@ -105,9 +105,15 @@
int exitStatus = (([self totalFailures] == 0U) ? 0 : 1);
// Alternative to exit(status); so it cleanly terminates the UIApplication
// and classes that depend on this signal to exit cleanly.
- if ([application respondsToSelector:@selector(_terminateWithStatus:)]) {
- [application performSelector:@selector(_terminateWithStatus:)
- withObject:(id)exitStatus];
+ NSMethodSignature * terminateSignature
+ = [UIApplication instanceMethodSignatureForSelector:@selector(_terminateWithStatus:)];
+ if (terminateSignature != nil) {
+ NSInvocation * terminateInvocation
+ = [NSInvocation invocationWithMethodSignature:terminateSignature];
+ [terminateInvocation setTarget:application];
+ [terminateInvocation setSelector:@selector(_terminateWithStatus:)];
+ [terminateInvocation setArgument:&exitStatus atIndex:2];
+ [terminateInvocation invoke];
} else {
exit(exitStatus);
}
@@ -224,7 +230,7 @@ static int ClassSort(const void *a, const void *b) {
= [suiteEndDate timeIntervalSinceDate:suiteStartDate];
NSString *suiteEndString
= [NSString stringWithFormat:@"Test Suite '%@' finished at %@.\n"
- "Executed %d tests, with %d failures (%d "
+ "Executed %tu tests, with %tu failures (%tu "
"unexpected) in %0.3f (%0.3f) seconds\n\n",
suiteName, suiteEndDate,
totalSuccesses_ + totalFailures_,
diff --git a/UnitTesting/GTMSenTestCase.m b/UnitTesting/GTMSenTestCase.m
index fab3ee0..e9c4ecf 100644
--- a/UnitTesting/GTMSenTestCase.m
+++ b/UnitTesting/GTMSenTestCase.m
@@ -329,7 +329,7 @@ NSString *const SenTestLineNumberKey = @"SenTestLineNumberKey";
}
// Used for sorting methods below
-static int MethodSort(id a, id b, void *context) {
+static NSInteger MethodSort(id a, id b, void *context) {
NSInvocation *invocationA = a;
NSInvocation *invocationB = b;
const char *nameA = sel_getName([invocationA selector]);
@@ -391,7 +391,7 @@ static int MethodSort(id a, id b, void *context) {
}
}
// Match SenTestKit and run everything in alphbetical order.
- [invocations sortUsingFunction:MethodSort context:nil];
+ [invocations sortUsingFunction:&MethodSort context:nil];
return invocations;
}