diff options
author | 2010-05-27 14:01:11 +0000 | |
---|---|---|
committer | 2010-05-27 14:01:11 +0000 | |
commit | dca2c72842b9e34a094bef74a04970cfa39bce14 (patch) | |
tree | f7cbdaaea18678b07bb9c8d619ace732372062b4 /Foundation/GTMPathTest.m | |
parent | ba1f5cc81b31e6c017eb59a525ec7eb4426bcca3 (diff) |
[Author: dmaclach]
Deprecate GTMPath
R=thomasvl
DELTA=51 (15 added, 32 deleted, 4 changed)
Diffstat (limited to 'Foundation/GTMPathTest.m')
-rw-r--r-- | Foundation/GTMPathTest.m | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/Foundation/GTMPathTest.m b/Foundation/GTMPathTest.m index aec0731..1e58f50 100644 --- a/Foundation/GTMPathTest.m +++ b/Foundation/GTMPathTest.m @@ -20,6 +20,9 @@ #import "GTMPath.h" #import "GTMUnitTestDevLog.h" +#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 +// NSFileManager has improved substantially in Leopard and beyond, so GTMPath +// is now deprecated. @interface GTMPathTest : GTMTestCase { @private @@ -36,16 +39,8 @@ testDirectory_ = [[tmp stringByAppendingPathComponent:@"GTMPathTest"] retain]; STAssertNotNil(testDirectory_, nil); - BOOL created = NO; NSFileManager *mgr = [NSFileManager defaultManager]; -#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 - NSError *error = nil; - created = [mgr createDirectoryAtPath:testDirectory_ - withIntermediateDirectories:YES attributes:nil error:&error]; - STAssertNil(error, @"Can't create dir at %@ error:%@", testDirectory_, error); -#else - created = [mgr createDirectoryAtPath:testDirectory_ attributes:nil]; -#endif // MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 + BOOL created = [mgr createDirectoryAtPath:testDirectory_ attributes:nil]; STAssertTrue(created, nil); } @@ -53,11 +48,7 @@ // Make sure it's safe to remove this directory before nuking it. STAssertNotNil(testDirectory_, nil); STAssertNotEqualObjects(testDirectory_, @"/", nil); -#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 - [[NSFileManager defaultManager] removeItemAtPath:testDirectory_ error:NULL]; -#else [[NSFileManager defaultManager] removeFileAtPath:testDirectory_ handler:nil]; -#endif // MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 [testDirectory_ release]; } @@ -241,3 +232,5 @@ } @end + +#endif // MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 |