aboutsummaryrefslogtreecommitdiff
path: root/UnitTesting/GTMSenTestCase.h
diff options
context:
space:
mode:
authorGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2009-09-15 21:15:30 +0000
committerGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2009-09-15 21:15:30 +0000
commit19bacc9c46de4624b2a3d4a78a128ac90e94bc41 (patch)
treed51d8566a0f8c99a1a3216fcb284a5cf4f7c3b58 /UnitTesting/GTMSenTestCase.h
parent4c0fe7ccc26630c18926f15bf017b6fcf191bf1b (diff)
[Author: dmaclach]
Fix up GTMSenTestCase to compile nicely under clang. Fix for http://code.google.com/p/google-toolbox-for-mac/issues/detail?id=34. R=thomasvl DELTA=17 (0 added, 0 deleted, 17 changed)
Diffstat (limited to 'UnitTesting/GTMSenTestCase.h')
-rw-r--r--UnitTesting/GTMSenTestCase.h34
1 files changed, 17 insertions, 17 deletions
diff --git a/UnitTesting/GTMSenTestCase.h b/UnitTesting/GTMSenTestCase.h
index 3b4dcab..9837b2b 100644
--- a/UnitTesting/GTMSenTestCase.h
+++ b/UnitTesting/GTMSenTestCase.h
@@ -197,7 +197,7 @@ do { \
#define STAssertNotEquals(a1, a2, description, ...) \
do { \
@try { \
- if (@encode(__typeof__(a1)) != @encode(__typeof__(a2))) { \
+ if (strcmp(@encode(__typeof__(a1)), @encode(__typeof__(a2)))) { \
[self failWithException:[NSException failureInFile:[NSString stringWithUTF8String:__FILE__] \
atLine:__LINE__ \
withDescription:[@"Type mismatch -- " stringByAppendingString:STComposeString(description, ##__VA_ARGS__)]]]; \
@@ -238,16 +238,16 @@ do { \
@try { \
id a1value = (a1); \
id a2value = (a2); \
- if ( (@encode(__typeof__(a1value)) == @encode(id)) && \
- (@encode(__typeof__(a2value)) == @encode(id)) && \
- ![(id)a1value isEqual:(id)a2value] ) continue; \
- NSString *_expression = [NSString stringWithFormat:@"%s('%@') != %s('%@')", #a1, [a1 description], #a2, [a2 description]]; \
- if (desc != nil) { \
- _expression = [NSString stringWithFormat:@"%@: %@", _expression, STComposeString(desc, ##__VA_ARGS__)]; \
- } \
- [self failWithException:[NSException failureInFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:_expression]]; \
+ if ((strcmp(@encode(__typeof__(a1value)), @encode(id)) == 0) && \
+ (strcmp(@encode(__typeof__(a2value)), @encode(id)) == 0) && \
+ ![(id)a1value isEqual:(id)a2value]) continue; \
+ NSString *_expression = [NSString stringWithFormat:@"%s('%@') != %s('%@')", #a1, [a1 description], #a2, [a2 description]]; \
+ if (desc != nil) { \
+ _expression = [NSString stringWithFormat:@"%@: %@", _expression, STComposeString(desc, ##__VA_ARGS__)]; \
+ } \
+ [self failWithException:[NSException failureInFile:[NSString stringWithUTF8String:__FILE__] \
+ atLine:__LINE__ \
+ withDescription:_expression]]; \
} \
@catch (id anException) { \
[self failWithException:[NSException failureInRaise:[NSString stringWithFormat: @"(%s) != (%s)", #a1, #a2] \
@@ -269,7 +269,7 @@ do { \
#define STAssertOperation(a1, a2, op, description, ...) \
do { \
@try { \
- if (@encode(__typeof__(a1)) != @encode(__typeof__(a2))) { \
+ if (strcmp(@encode(__typeof__(a1)), @encode(__typeof__(a2)))) { \
[self failWithException:[NSException failureInFile:[NSString stringWithUTF8String:__FILE__] \
atLine:__LINE__ \
withDescription:[@"Type mismatch -- " stringByAppendingString:STComposeString(description, ##__VA_ARGS__)]]]; \
@@ -486,9 +486,9 @@ do { \
id a1value = (a1); \
id a2value = (a2); \
if (a1value == a2value) continue; \
- if ( (@encode(__typeof__(a1value)) == @encode(id)) && \
- (@encode(__typeof__(a2value)) == @encode(id)) && \
- [(id)a1value isEqual: (id)a2value] ) continue; \
+ if ((strcmp(@encode(__typeof__(a1value)), @encode(id)) == 0) && \
+ (strcmp(@encode(__typeof__(a2value)),@encode(id) == 0) && \
+ [(id)a1value isEqual: (id)a2value]) continue; \
[self failWithException:[NSException failureInEqualityBetweenObject: a1value \
andObject: a2value \
inFile: [NSString stringWithUTF8String:__FILE__] \
@@ -516,7 +516,7 @@ do { \
#define STAssertEquals(a1, a2, description, ...) \
do { \
@try { \
- if (@encode(__typeof__(a1)) != @encode(__typeof__(a2))) { \
+ if (strcmp(@encode(__typeof__(a1)), @encode(__typeof__(a2)))) { \
[self failWithException:[NSException failureInFile:[NSString stringWithUTF8String:__FILE__] \
atLine:__LINE__ \
withDescription:[@"Type mismatch -- " stringByAppendingString:STComposeString(description, ##__VA_ARGS__)]]]; \
@@ -562,7 +562,7 @@ do { \
#define STAssertEqualsWithAccuracy(a1, a2, accuracy, description, ...) \
do { \
@try { \
- if (@encode(__typeof__(a1)) != @encode(__typeof__(a2))) { \
+ if (strcmp(@encode(__typeof__(a1)), @encode(__typeof__(a2)))) { \
[self failWithException:[NSException failureInFile:[NSString stringWithUTF8String:__FILE__] \
atLine:__LINE__ \
withDescription:[@"Type mismatch -- " stringByAppendingString:STComposeString(description, ##__VA_ARGS__)]]]; \