diff options
-rw-r--r-- | Foundation/GTMLoggerTest.m | 9 | ||||
-rw-r--r-- | Foundation/GTMNSFileManager+PathTest.m | 5 |
2 files changed, 11 insertions, 3 deletions
diff --git a/Foundation/GTMLoggerTest.m b/Foundation/GTMLoggerTest.m index 2d6824a..0cd7dc7 100644 --- a/Foundation/GTMLoggerTest.m +++ b/Foundation/GTMLoggerTest.m @@ -295,7 +295,9 @@ [fh logMessage:@"test 4" level:kGTMLoggerLevelAssert]; [fh closeFile]; - NSString *contents = [NSString stringWithContentsOfFile:path_]; + NSString *contents = [NSString stringWithContentsOfFile:path_ + encoding:NSUTF8StringEncoding + error:nil]; STAssertEqualObjects(@"test 0\ntest 1\ntest 2\ntest 3\ntest 4\n", contents, nil); } @@ -458,7 +460,10 @@ [fh logMessage:@"test 6" level:kGTMLoggerLevelInfo]; [fh closeFile]; - NSString *contents = [NSString stringWithContentsOfFile:path_]; + NSString *contents = [NSString stringWithContentsOfFile:path_ + encoding:NSUTF8StringEncoding + error:NULL]; + STAssertNotNil(contents, nil); STAssertEqualObjects(@"test 1\ntest 2\ntest 3\ntest 4\ntest 5\ntest 6\n", contents, nil); } diff --git a/Foundation/GTMNSFileManager+PathTest.m b/Foundation/GTMNSFileManager+PathTest.m index db40c68..756eb54 100644 --- a/Foundation/GTMNSFileManager+PathTest.m +++ b/Foundation/GTMNSFileManager+PathTest.m @@ -141,7 +141,10 @@ } for (size_t j = 0; j < sizeof(testFiles) / sizeof(NSString*); j++) { NSString *testFile = [testDir stringByAppendingPathComponent:testFiles[j]]; - STAssertTrue([@"test" writeToFile:testFile atomically:YES], nil); + STAssertTrue([@"test" writeToFile:testFile + atomically:YES + encoding:NSUTF8StringEncoding + error:nil], nil); } } |