aboutsummaryrefslogtreecommitdiff
path: root/UnitTesting
diff options
context:
space:
mode:
authorGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2010-07-02 20:06:34 +0000
committerGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2010-07-02 20:06:34 +0000
commit4d5b01da0879f09e3777cf423bed5d3db5d2e149 (patch)
treea86a6ad927849e627f4bc8629f3eef1088eae9cb /UnitTesting
parentfbb096517f8fd8231ccff9166d55b097de4dfcf8 (diff)
[Author: dmaclach]
Fix up GTMSenTestCase by making special code simulator only. This fixes building on Tiger and isolates the interesting case. R=thomasvl DELTA=8 (6 added, 1 deleted, 1 changed)
Diffstat (limited to 'UnitTesting')
-rw-r--r--UnitTesting/GTMSenTestCase.m9
1 files changed, 7 insertions, 2 deletions
diff --git a/UnitTesting/GTMSenTestCase.m b/UnitTesting/GTMSenTestCase.m
index 099c2f2..99eacef 100644
--- a/UnitTesting/GTMSenTestCase.m
+++ b/UnitTesting/GTMSenTestCase.m
@@ -19,7 +19,9 @@
#import "GTMSenTestCase.h"
#import <unistd.h>
+#if GTM_IPHONE_SIMULATOR
#import <objc/message.h>
+#endif
#import "GTMObjC2Runtime.h"
#import "GTMUnitTestDevLog.h"
@@ -290,13 +292,16 @@ NSString *const SenTestLineNumberKey = @"SenTestLineNumberKey";
[self setUp];
@try {
NSInvocation *invocation = [self invocation];
+#if GTM_IPHONE_SIMULATOR
// We don't call [invocation invokeWithTarget:self]; because of
// Radar 8081169: NSInvalidArgumentException can't be caught
// It turns out that on iOS4 (and 3.2) exceptions thrown inside an
- // [invocation invoke] call cannot be caught.
+ // [invocation invoke] on the simulator cannot be caught.
// http://openradar.appspot.com/8081169
- // Calling it this way appears to work on both platforms.
objc_msgSend(self, [invocation selector]);
+#else
+ [invocation invokeWithTarget:self];
+#endif
} @catch (NSException *exception) {
e = [exception retain];
}