aboutsummaryrefslogtreecommitdiff
path: root/UnitTesting/GTMSenTestCaseTest.m
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/GTMSenTestCaseTest.m
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/GTMSenTestCaseTest.m')
-rw-r--r--UnitTesting/GTMSenTestCaseTest.m22
1 files changed, 16 insertions, 6 deletions
diff --git a/UnitTesting/GTMSenTestCaseTest.m b/UnitTesting/GTMSenTestCaseTest.m
index 9d9a594..33055ad 100644
--- a/UnitTesting/GTMSenTestCaseTest.m
+++ b/UnitTesting/GTMSenTestCaseTest.m
@@ -16,6 +16,15 @@
// the License.
//
+#import "GTMDefines.h"
+
+// This test currently executes under XCTest and under the GTM SenTest replacement.
+#if !GTM_USING_XCTEST
+#define XCTAssertFalse STAssertFalse
+#define XCTAssertEqual STAssertEquals
+#define XCTAssertTrue STAssertTrue
+#endif // !GTM_USING_XCTEST
+
#import "GTMSenTestCase.h"
// These make use of the fact that methods are run in alphebetical order
@@ -39,8 +48,8 @@ static int gZzCheckCalls_ = 0;
@implementation GTMTestingAbstractTest
- (void)testAbstractUnitTest {
- STAssertFalse([self isMemberOfClass:[GTMTestingAbstractTest class]],
- @"test should not run on the abstract class");
+ XCTAssertFalse([self isMemberOfClass:[GTMTestingAbstractTest class]],
+ @"test should not run on the abstract class");
++gAbstractCalls_;
}
@@ -51,11 +60,12 @@ static int gZzCheckCalls_ = 0;
- (void)testZZCheck {
++gZzCheckCalls_;
if ([self isMemberOfClass:[GTMTestingTestOne class]]) {
- STAssertEquals(gAbstractCalls_, 1,
+ XCTAssertEqual(gAbstractCalls_, 1,
@"wrong number of abstract calls at this point");
} else {
- STAssertTrue([self isMemberOfClass:[GTMTestingTestTwo class]], nil);
- STAssertEquals(gAbstractCalls_, 2,
+ XCTAssertTrue([self isMemberOfClass:[GTMTestingTestTwo class]],
+ @"Not member of class");
+ XCTAssertEqual(gAbstractCalls_, 2,
@"wrong number of abstract calls at this point");
}
}
@@ -66,7 +76,7 @@ static int gZzCheckCalls_ = 0;
- (void)testZZZCheck {
// Test defined at this leaf, it should always run, check on the other methods.
- STAssertEquals(gZzCheckCalls_, 2, @"the parent class method wasn't called");
+ XCTAssertEqual(gZzCheckCalls_, 2, @"the parent class method wasn't called");
}
@end