Skip to content

Commit

Permalink
Removed time critical tests. When cancelling after uncompressing the …
Browse files Browse the repository at this point in the history
…same code paths are run.
  • Loading branch information
Stefan Gugarel committed Sep 15, 2015
1 parent 3680529 commit d099a31
Showing 1 changed file with 0 additions and 45 deletions.
45 changes: 0 additions & 45 deletions Test/Source/DTZipArchiveTest.m
Expand Up @@ -407,26 +407,6 @@ - (void)testCancelUncompressingPKZip
[NSThread sleepForTimeInterval:0.2f];
}

- (void)testCancelUncompressingPKZipAfter100us
{
// get sample.zip file
NSBundle *testBundle = [NSBundle bundleForClass:[self class]];
NSString *sampleZipPath = [testBundle pathForResource:@"sample" ofType:@"zip"];

DTZipArchive *zipArchive = [DTZipArchive archiveAtPath:sampleZipPath];

[zipArchive uncompressToPath:[testBundle bundlePath] completion:^(NSError *error) {

XCTFail(@"Should not complete uncompressing after cancel was called");
}];

[NSThread sleepForTimeInterval:0.00001f];

// cancel uncompression after 1ms -> to cancel in while loop
[zipArchive cancelAllUncompressing];

[NSThread sleepForTimeInterval:0.5f];
}

/**
Do uncompressing with illegal manually create node -> Error should be raised
Expand Down Expand Up @@ -615,39 +595,14 @@ - (void)testCancelUncompressingGZip

DTZipArchivePKZip *zipArchive = (DTZipArchivePKZip *)[DTZipArchive archiveAtPath:sampleZipPath];

// suspend the queue to let us set the cancel
dispatch_suspend(zipArchive.uncompressingQueue);

[zipArchive uncompressToPath:[testBundle bundlePath] completion:^(NSError *error) {

XCTFail(@"Should not complete uncompressing after cancel was called");
}];

// resume
[zipArchive cancelAllUncompressing];

dispatch_resume(zipArchive.uncompressingQueue);

[NSThread sleepForTimeInterval:0.2];
}

- (void)testCancelUncompressingGZipAfter1ms
{
// get sample.zip file
NSBundle *testBundle = [NSBundle bundleForClass:[self class]];
NSString *sampleZipPath = [testBundle pathForResource:@"gzip_sample.txt" ofType:@"gz"];

DTZipArchive *zipArchive = [DTZipArchive archiveAtPath:sampleZipPath];

[zipArchive uncompressToPath:[testBundle bundlePath] completion:^(NSError *error) {

XCTFail(@"Should not complete uncompressing after cancel was called");
}];

[NSThread sleepForTimeInterval:0.0001];

[zipArchive cancelAllUncompressing];

[NSThread sleepForTimeInterval:0.2];
}

Expand Down

0 comments on commit d099a31

Please sign in to comment.