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/GTMNSString+FindFolderTest.m | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'Foundation/GTMNSString+FindFolderTest.m') diff --git a/Foundation/GTMNSString+FindFolderTest.m b/Foundation/GTMNSString+FindFolderTest.m index aae48cb..2f53d76 100644 --- a/Foundation/GTMNSString+FindFolderTest.m +++ b/Foundation/GTMNSString+FindFolderTest.m @@ -6,9 +6,9 @@ // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy // of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -32,20 +32,20 @@ inDomain:kUserDomain doCreate:NO]; NSString *realPrefsPath = [@"~/Library/Preferences" stringByExpandingTildeInPath]; - STAssertEqualObjects(realPrefsPath, prefsPath, @"Found incorrect prefs path"); + XCTAssertEqualObjects(realPrefsPath, prefsPath, @"Found incorrect prefs path"); + - // test the subfolder method; it should return nil if we pass NO and the // subfolder doesn't already exist - + NSString *googCacheNoCreatePath = [NSString gtm_stringWithPathForFolder:kCachedDataFolderType subfolderName:@"GTMUnitTestDuzntExist" inDomain:kUserDomain doCreate:NO]; - STAssertNil(googCacheNoCreatePath, @"Should not exist: %@", googCacheNoCreatePath); + XCTAssertNil(googCacheNoCreatePath, @"Should not exist: %@", googCacheNoCreatePath); // test creating ~/Library/Cache/GTMUnitTestCreated - + NSString *folderName = @"GTMUnitTestCreated"; NSString *gtmCachePath = [NSString gtm_stringWithPathForFolder:kCachedDataFolderType subfolderName:folderName @@ -55,28 +55,28 @@ inDomain:kUserDomain doCreate:NO]; NSString *testPathAppended = [testPath stringByAppendingPathComponent:folderName]; - STAssertEqualObjects(gtmCachePath, testPathAppended, @"Unexpected path name"); - + XCTAssertEqualObjects(gtmCachePath, testPathAppended, @"Unexpected path name"); + NSFileManager* fileMgr = [NSFileManager defaultManager]; BOOL isDir = NO; BOOL pathExists = [fileMgr fileExistsAtPath:gtmCachePath isDirectory:&isDir] && isDir; - STAssertTrue(pathExists, @"Path %@ is not existing like it should", gtmCachePath); + XCTAssertTrue(pathExists, @"Path %@ is not existing like it should", gtmCachePath); // test finding it again w/o having to create it NSString *gtmCachePath2 = [NSString gtm_stringWithPathForFolder:kCachedDataFolderType subfolderName:folderName inDomain:kUserDomain doCreate:NO]; - STAssertEqualObjects(gtmCachePath2, gtmCachePath, nil); - + XCTAssertEqualObjects(gtmCachePath2, gtmCachePath); + #if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 NSError *error = nil; BOOL didRemove = [fileMgr removeItemAtPath:gtmCachePath error:&error]; - STAssertTrue(didRemove, @"Error removing %@ (%@)", gtmCachePath, error); + XCTAssertTrue(didRemove, @"Error removing %@ (%@)", gtmCachePath, error); #else BOOL didRemove = [fileMgr removeFileAtPath:gtmCachePath handler:nil]; - STAssertTrue(didRemove, @"Error removing %@", gtmCachePath); + XCTAssertTrue(didRemove, @"Error removing %@", gtmCachePath); #endif // MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 } -- cgit v1.2.3