aboutsummaryrefslogtreecommitdiff
path: root/Foundation/GTMPathTest.m
diff options
context:
space:
mode:
authorGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2010-05-14 19:35:54 +0000
committerGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2010-05-14 19:35:54 +0000
commit4f89cfe836e82f9445b98d733d6eb54b86e609d2 (patch)
treedd5f8eb01940af1a98922254baa93437936dc2ed /Foundation/GTMPathTest.m
parent4e865a397220fcca9975de0ed393ed7a145234d2 (diff)
[Author: dmaclach]
There are still a couple of errors occurring, but this fixes up the majority of stuff. I figured I'd send it out to you now to take a look at in the morning, and then we can clean up the last couple of issues. Not quite sure what to do about the naming of data files so that we can encompass ranges of system version (e.g. this file applies to 10.5 and 10.6 but not 10.4 or 10.7. R=thomasvl DELTA=10598 (10211 added, 70 deleted, 317 changed)
Diffstat (limited to 'Foundation/GTMPathTest.m')
-rw-r--r--Foundation/GTMPathTest.m21
1 files changed, 14 insertions, 7 deletions
diff --git a/Foundation/GTMPathTest.m b/Foundation/GTMPathTest.m
index 211206c..aec0731 100644
--- a/Foundation/GTMPathTest.m
+++ b/Foundation/GTMPathTest.m
@@ -36,9 +36,16 @@
testDirectory_ = [[tmp stringByAppendingPathComponent:@"GTMPathTest"] retain];
STAssertNotNil(testDirectory_, nil);
- BOOL created = [[NSFileManager defaultManager]
- createDirectoryAtPath:testDirectory_
- attributes: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
STAssertTrue(created, nil);
}
@@ -46,11 +53,11 @@
// 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] removeFileAtPath:testDirectory_ handler:nil];
-#else
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
[[NSFileManager defaultManager] removeItemAtPath:testDirectory_ error:NULL];
-#endif
+#else
+ [[NSFileManager defaultManager] removeFileAtPath:testDirectory_ handler:nil];
+#endif // MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
[testDirectory_ release];
}