aboutsummaryrefslogtreecommitdiff
path: root/UnitTesting/GTMSenTestCase.h
diff options
context:
space:
mode:
authorGravatar dmaclach <dmaclach@google.com>2016-10-07 12:10:23 -0400
committerGravatar Thomas Van Lenten <thomasvl@google.com>2016-10-07 12:21:06 -0400
commit42124b3691197c3c4f52f069775fa0390a8ff942 (patch)
treeebd373d398ea64b45bdc1d196fa0a2c5f57cabfd /UnitTesting/GTMSenTestCase.h
parent57eeab4193210df8ab0c81e9d3f1ee1ad3e24492 (diff)
First cut at pruning things/updating things.
Remove a bunch of code that Google stopped using/maintaining rather than trying to update it it. Some would be hard to update, some actually has system provided replacements; others are patterns that just don't seem as common now. Prune out the code related to macOS <= 10.5, start pruning some of the really old iOS support also. Get the projects mostly limping again with modern Xcodes so tests can be run. If someone ends up on this commit via history for something they still find as useful, feel free to do a pull request to bring the snippet of code back to life and update it for current SDKs.
Diffstat (limited to 'UnitTesting/GTMSenTestCase.h')
-rw-r--r--UnitTesting/GTMSenTestCase.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/UnitTesting/GTMSenTestCase.h b/UnitTesting/GTMSenTestCase.h
index a96cb20..6b7198b 100644
--- a/UnitTesting/GTMSenTestCase.h
+++ b/UnitTesting/GTMSenTestCase.h
@@ -90,7 +90,7 @@
#define _XCExceptionFormatString @"throwing \"%@\""
#define _XCUnknownExceptionString @"throwing an unknown exception"
-#if defined(__IPHONE_8_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_8_0
+#if (defined(__IPHONE_8_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_8_0) || (GTM_MACOS_SDK == 1)
// They changed the call to _XCTRegisterFailure in iOS 8. Once we no longer need to support
// the iOS 7 SDK, we can remove this.
#define _GTMXCRegisterFailure(expression, format...) _XCTRegisterFailure(self, expression, format)
@@ -111,7 +111,7 @@
@try { \
__typeof__(a1) _a1value = (a1); \
if (_a1value != noErr) { \
- _failure = [NSString stringWithFormat:@"%ld != noErr", (long)_a1value]; \
+ _failure = [NSString stringWithFormat:@"%d != noErr", (int)_a1value]; \
} \
} \
@catch (NSException *_exception) { \
@@ -142,7 +142,7 @@
__typeof__(a1) _a1value = (a1); \
__typeof__(a2) _a2value = (a2); \
if (_a1value != _a2value) { \
- _failure = [NSString stringWithFormat:@"(%ld) != (%ld)", (long)_a1value, (long)_a2value]; \
+ _failure = [NSString stringWithFormat:@"(%d) != (%d)", (int)_a1value, (int)_a2value]; \
} \
} \
@catch (NSException *_exception) { \
@@ -152,7 +152,7 @@
_failure = @": " _XCUnknownExceptionString; \
} \
if (_failure) { \
- NSString *_expression = [NSString stringWithFormat:@"((%@) != (@%)) failed %@", @#a1, @#a2, _failure]; \
+ NSString *_expression = [NSString stringWithFormat:@"((%@) != (%@)) failed %@", @#a1, @#a2, _failure]; \
_GTMXCRegisterFailure(_expression, format); \
} \
})
@@ -734,12 +734,12 @@ do { \
// SENTE_BEGIN
/*" Generates a failure when !{ [a1 isEqualTo:a2] } is false
- (or one is nil and the other is not).
- _{a1 The object on the left.}
- _{a2 The object on the right.}
- _{description A format string as in the printf() function. Can be nil or
- an empty string but must be present.}
- _{... A variable number of arguments to the format string. Can be absent.}
+ (or one is nil and the other is not).
+ _{a1 The object on the left.}
+ _{a2 The object on the right.}
+ _{description A format string as in the printf() function. Can be nil or
+ an empty string but must be present.}
+ _{... A variable number of arguments to the format string. Can be absent.}
"*/
#define STAssertEqualObjects(a1, a2, description, ...) \
do { \