Fix for file creation date + tests
This commit is contained in:
parent
7627a1b4fc
commit
548b3acbba
@ -399,7 +399,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
zipOpenNewFileInZip(_zip, afileName, NULL, NULL, 0, NULL, 0, NULL, Z_DEFLATED, Z_DEFAULT_COMPRESSION);
|
||||
zipOpenNewFileInZip(_zip, afileName, &zipInfo, NULL, 0, NULL, 0, NULL, Z_DEFLATED, Z_DEFAULT_COMPRESSION);
|
||||
|
||||
void *buffer = malloc(CHUNK);
|
||||
unsigned int len = 0;
|
||||
|
@ -136,6 +136,26 @@
|
||||
STAssertTrue(unicodeFolderWasExtracted, @"Folders with names in unicode should be extracted propertly.");
|
||||
}
|
||||
|
||||
- (void)testZippingAndUnzippingForDate {
|
||||
|
||||
NSString *inputPath = [self _cachesPath:@"Regular"];
|
||||
NSArray *inputPaths = [NSArray arrayWithObjects:
|
||||
[inputPath stringByAppendingPathComponent:@"Readme.markdown"],
|
||||
nil];
|
||||
|
||||
NSDictionary *originalFileAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:[inputPath stringByAppendingPathComponent:@"Readme.markdown"] error:nil];
|
||||
|
||||
NSString *outputPath = [self _cachesPath:@"ZippedDate"];
|
||||
NSString *archivePath = [outputPath stringByAppendingPathComponent:@"CreatedArchive.zip"];
|
||||
|
||||
[SSZipArchive createZipFileAtPath:archivePath withFilesAtPaths:inputPaths];
|
||||
[SSZipArchive unzipFileAtPath:archivePath toDestination:outputPath delegate:self];
|
||||
|
||||
NSDictionary *createdFileAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:[outputPath stringByAppendingPathComponent:@"Readme.markdown"] error:nil];
|
||||
|
||||
STAssertEquals(originalFileAttributes[@"NSFileCreationDate"], createdFileAttributes[@"NSFileCreationDate"], @"Orginal file creationDate should match created one");
|
||||
}
|
||||
|
||||
// Commented out to avoid checking in several gig file into the repository. Simply add a file named
|
||||
// `LargeArchive.zip` to the project and uncomment out these lines to test.
|
||||
//
|
||||
|
Loading…
Reference in New Issue
Block a user