Permalink
Browse files

Reenabled cleanup

  • Loading branch information...
1 parent 088eef2 commit d56686295d044cb4cef9b3354df88eca81c7bb5b @odrobnik odrobnik committed Jan 16, 2012
Showing with 10 additions and 9 deletions.
  1. +10 −9 Test/UnitTest.m
View
@@ -87,10 +87,10 @@ - (int)runExecutable:(NSString *)launchPath withArguments:(NSArray *)arguments
- (void)internalTestCaseWithURL:(NSURL *)URL withTempPath:(NSString *)tempPath
{
NSFileManager *fileManager = [NSFileManager defaultManager];
-
+
// test case temp path is global temp path plus name of this test case
tempPath = [tempPath stringByAppendingPathComponent:testCaseNameFromURL(URL, YES)];
-
+
NSString *genstrings1OutPath = [tempPath stringByAppendingPathComponent:@"genstrings1"];
[fileManager createDirectoryAtPath:genstrings1OutPath withIntermediateDirectories:YES attributes:NULL error:NULL];
@@ -105,12 +105,12 @@ - (void)internalTestCaseWithURL:(NSURL *)URL withTempPath:(NSString *)tempPath
DTLocalizableStringAggregator *aggregator = [[DTLocalizableStringAggregator alloc] init];
NSDictionary *genstrings2Parameters = [testParameters objectForKey:@"genstrings2"];
-
+
if (genstrings2Parameters)
{
[aggregator setValuesForKeysWithDictionary:genstrings2Parameters];
}
-
+
[aggregator beginProcessingFile:URL];
NSArray *tables = [aggregator aggregatedStringTables];
@@ -156,7 +156,7 @@ - (void)internalTestCaseWithURL:(NSURL *)URL withTempPath:(NSString *)tempPath
// check if number is the same
STAssertEquals([genstrings1files count], [genstrings2files count], @"Different number of output strings tables");
-
+
for (NSString *oneFile in genstrings1files)
{
STAssertTrue([genstrings2files containsObject:oneFile], @"genstring2 output is missing %@", oneFile);
@@ -178,7 +178,10 @@ - (void)internalTestCaseWithURL:(NSURL *)URL withTempPath:(NSString *)tempPath
NSString *genstrings1Contents = [NSString stringWithContentsOfFile:genstrings1File usedEncoding:NULL error:NULL];
NSString *genstrings2Contents = [NSString stringWithContentsOfFile:genstrings2File usedEncoding:NULL error:NULL];
-
+
+ // size check does not work because predicate editor output repeats comment for each token
+ // STAssertEquals([genstrings1Contents length], [genstrings2Contents length], @"Different file sizes on %@", genstrings1File);
+
NSDictionary *genstrings1Stuff = [genstrings1Contents propertyListFromStringsFileFormat];
NSDictionary *genstrings2Stuff = [genstrings2Contents propertyListFromStringsFileFormat];
@@ -205,10 +208,8 @@ - (void)internalTestCaseWithURL:(NSURL *)URL withTempPath:(NSString *)tempPath
}
}
- NSLog(@"%@", tempPath);
-
// cleanup
- //[[NSFileManager defaultManager] removeItemAtPath:tempPath error:NULL];
+ [[NSFileManager defaultManager] removeItemAtPath:tempPath error:NULL];
}

0 comments on commit d566862

Please sign in to comment.