From 42124b3691197c3c4f52f069775fa0390a8ff942 Mon Sep 17 00:00:00 2001 From: dmaclach Date: Fri, 7 Oct 2016 12:10:23 -0400 Subject: 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. --- Foundation/GTMNSObject+KeyValueObservingTest.m | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) (limited to 'Foundation/GTMNSObject+KeyValueObservingTest.m') diff --git a/Foundation/GTMNSObject+KeyValueObservingTest.m b/Foundation/GTMNSObject+KeyValueObservingTest.m index 43a1bba..66ae799 100644 --- a/Foundation/GTMNSObject+KeyValueObservingTest.m +++ b/Foundation/GTMNSObject+KeyValueObservingTest.m @@ -29,7 +29,6 @@ #import "GTMSenTestCase.h" #import "GTMNSObject+KeyValueObserving.h" #import "GTMDefines.h" -#import "GTMUnitTestDevLog.h" @interface GTMNSObject_KeyValueObservingTest : GTMTestCase { int32_t count_; @@ -61,12 +60,12 @@ options:NSKeyValueObservingOptionNew]; expectedValue_ = @"bar"; [dict_ setObject:expectedValue_ forKey:@"key"]; - STAssertEquals(count_, (int32_t)1, nil); + XCTAssertEqual(count_, (int32_t)1); [dict_ gtm_removeObserver:self forKeyPath:@"key" selector:@selector(observeValueChange:)]; [dict_ setObject:@"foo" forKey:@"key"]; - STAssertEquals(count_, (int32_t)1, nil); + XCTAssertEqual(count_, (int32_t)1); } - (void)testStopObservingAllKeyPaths { @@ -78,17 +77,14 @@ options:NSKeyValueObservingOptionNew]; expectedValue_ = @"bar"; [dict_ setObject:expectedValue_ forKey:@"key"]; - STAssertEquals(count_, (int32_t)1, nil); + XCTAssertEqual(count_, (int32_t)1); [self gtm_stopObservingAllKeyPaths]; [dict_ setObject:@"foo" forKey:@"key"]; - STAssertEquals(count_, (int32_t)1, nil); + XCTAssertEqual(count_, (int32_t)1); } - (void)testRemoving { - [GTMUnitTestDevLogDebug expectPattern:@"-\\[GTMNSObject_KeyValueObservingTest" - @" testRemoving\\] was not observing.*"]; - [dict_ gtm_removeObserver:self forKeyPath:@"key" selector:@selector(observeValueChange:)]; @@ -100,8 +96,6 @@ selector:@selector(observeValueChange:) userInfo:@"userInfo" options:NSKeyValueObservingOptionNew]; - [GTMUnitTestDevLog expectPattern:@"-\\[GTMNSObject_KeyValueObservingTest" - @" testAdding\\] already observing.*"]; [dict_ gtm_addObserver:self forKeyPath:@"key" selector:@selector(observeValueChange:) @@ -113,17 +107,17 @@ } - (void)observeValueChange:(GTMKeyValueChangeNotification *)notification { - STAssertEqualObjects([notification userInfo], @"userInfo", nil); - STAssertEqualObjects([notification keyPath], @"key", nil); - STAssertEqualObjects([notification object], dict_, nil); + XCTAssertEqualObjects([notification userInfo], @"userInfo"); + XCTAssertEqualObjects([notification keyPath], @"key"); + XCTAssertEqualObjects([notification object], dict_); NSDictionary *change = [notification change]; NSString *value = [change objectForKey:NSKeyValueChangeNewKey]; - STAssertEqualObjects(value, expectedValue_, nil); + XCTAssertEqualObjects(value, expectedValue_); ++count_; GTMKeyValueChangeNotification *copy = [[notification copy] autorelease]; - STAssertEqualObjects(notification, copy, nil); - STAssertEquals([notification hash], [copy hash], nil); + XCTAssertEqualObjects(notification, copy); + XCTAssertEqual([notification hash], [copy hash]); } @end -- cgit v1.2.3