aboutsummaryrefslogtreecommitdiff
path: root/UnitTesting
diff options
context:
space:
mode:
authorGravatar Thomas Van Lenten <thomasvl@google.com>2015-10-20 12:57:17 -0400
committerGravatar Thomas Van Lenten <thomasvl@google.com>2015-10-20 12:57:17 -0400
commit79b5c2a55cb35167e44616cc9a67afa08014f7cb (patch)
treec561bb7d640a1c05d307a43cfbb26ee8d715ea20 /UnitTesting
parent472ee8d60445ce3b311f6f3d775cfba336a33421 (diff)
Minor fixes
- Support for GCC_WARN_STRICT_SELECTOR_MATCH - Fix long busted XTCAssertEqualCStrings
Diffstat (limited to 'UnitTesting')
-rw-r--r--UnitTesting/GTMSenTestCase.h18
-rw-r--r--UnitTesting/GTMUIUnitTestingHarness/English.lproj/Localizable.stringsbin685 -> 1372 bytes
2 files changed, 10 insertions, 8 deletions
diff --git a/UnitTesting/GTMSenTestCase.h b/UnitTesting/GTMSenTestCase.h
index 4c372c7..3ed752a 100644
--- a/UnitTesting/GTMSenTestCase.h
+++ b/UnitTesting/GTMSenTestCase.h
@@ -316,8 +316,8 @@
({ \
NSString *_failure = nil; \
@try { \
- id _a1value = (a1); \
- id _a2value = (a2); \
+ NSString *_a1value = (a1); \
+ NSString *_a2value = (a2); \
NSComparisonResult _result; \
if (![_a1value isKindOfClass:[NSString class]]) { \
_failure = [NSString stringWithFormat:@"(%@) is not an NSString* (%@)", @#a1, [_a1value class]]; \
@@ -356,8 +356,8 @@
({ \
NSString *_failure = nil; \
@try { \
- id _a1value = (a1); \
- id _a2value = (a2); \
+ NSString *_a1value = (a1); \
+ NSString *_a2value = (a2); \
NSComparisonResult _result; \
if (![_a1value isKindOfClass:[NSString class]]) { \
_failure = [NSString stringWithFormat:@"(%@) is not an NSString* (%@)", @#a1, [_a1value class]]; \
@@ -394,18 +394,20 @@
@try { \
const char* _a1value = (a1); \
const char* _a2value = (a2); \
- if (_a1value != _a2value && strcmp(_a1value, _a2value) != 0) { \
- _failure = @""; \
+ if (_a1value != _a2value && \
+ (_a1value == NULL || _a2value == NULL || strcmp(_a1value, _a2value) != 0)) { \
+ _failure = [NSString stringWithFormat:@"strcmp(\"%s\", \"%s\") != 0", _a1value, _a2value]; \
}\
} \
@catch (NSException *_exception) { \
_failure = [NSString stringWithFormat:@": " _XCExceptionFormatString, [_exception reason]]; \
} \
@catch (...) { \
- _failure = @": "_XCUnknownExceptionString; \
+ _failure = @": " _XCUnknownExceptionString; \
} \
if (_failure) { \
- NSString *_expression = [NSString stringWithFormat:@"((%s) == (%s) failed%@", @#a1, @#a2, _failure]; \
+ NSString *_expression = [NSString stringWithFormat:@"((%@) vs. (%@) failed: %@", \
+ GTM_NSSTRINGIFY(a1), GTM_NSSTRINGIFY(a2), _failure]; \
_GTMXCRegisterFailure(_expression, format); \
} \
})
diff --git a/UnitTesting/GTMUIUnitTestingHarness/English.lproj/Localizable.strings b/UnitTesting/GTMUIUnitTestingHarness/English.lproj/Localizable.strings
index 567e3f7..6eb49a5 100644
--- a/UnitTesting/GTMUIUnitTestingHarness/English.lproj/Localizable.strings
+++ b/UnitTesting/GTMUIUnitTestingHarness/English.lproj/Localizable.strings
Binary files differ