Update the test cases
This commit is contained in:
parent
b3a3a26a04
commit
2bfdac1f60
|
@ -195,13 +195,13 @@ static NSString *kTestImageKeyPNG = @"TestImageKey.png";
|
|||
}
|
||||
|
||||
- (void)test20InitialCacheSize{
|
||||
expect([[SDImageCache sharedImageCache] getSize]).to.equal(0);
|
||||
expect([[SDImageCache sharedImageCache] totalDiskSize]).to.equal(0);
|
||||
}
|
||||
|
||||
- (void)test21InitialDiskCount{
|
||||
XCTestExpectation *expectation = [self expectationWithDescription:@"getDiskCount"];
|
||||
[[SDImageCache sharedImageCache] storeImage:[self testJPEGImage] forKey:kTestImageKeyJPEG completion:^{
|
||||
expect([[SDImageCache sharedImageCache] getDiskCount]).to.equal(1);
|
||||
expect([[SDImageCache sharedImageCache] totalDiskCount]).to.equal(1);
|
||||
[[SDImageCache sharedImageCache] removeImageForKey:kTestImageKeyJPEG withCompletion:^{
|
||||
[expectation fulfill];
|
||||
}];
|
||||
|
|
|
@ -77,7 +77,7 @@
|
|||
}
|
||||
|
||||
- (void)removeExpiredData {
|
||||
NSDate *expirationDate = [NSDate dateWithTimeIntervalSinceNow:-self.config.maxCacheAge];
|
||||
NSDate *expirationDate = [NSDate dateWithTimeIntervalSinceNow:-self.config.maxDiskAge];
|
||||
for (NSString *fileName in [self.fileManager enumeratorAtPath:self.cachePath]) {
|
||||
NSString *filePath = [self.cachePath stringByAppendingPathComponent:fileName];
|
||||
NSDate *modificationDate = [[self.fileManager attributesOfItemAtPath:filePath error:nil] objectForKey:NSFileModificationDate];
|
||||
|
|
Loading…
Reference in New Issue