Update the unit test

Fix the `testUIViewCancelCurrentImageLoadWithTransition`
This commit is contained in:
DreamPiggy 2024-01-10 15:38:55 +08:00
parent 69e573c01d
commit b95b390f17
1 changed files with 6 additions and 4 deletions

View File

@ -344,12 +344,14 @@
- (void)testUIViewCancelCurrentImageLoadWithTransition { - (void)testUIViewCancelCurrentImageLoadWithTransition {
UIView *imageView = [[UIView alloc] init]; UIView *imageView = [[UIView alloc] init];
NSURL *firstImageUrl = [NSURL URLWithString:kTestJPEGURL]; NSURL *firstImageUrl = [NSURL URLWithString:@"https://placehold.co/201x201.jpg"];
NSURL *secondImageUrl = [NSURL URLWithString:kTestPNGURL]; NSURL *secondImageUrl = [NSURL URLWithString:@"https://placehold.co/201x201.png"];
// First, reset our caches // First, reset our caches
[SDImageCache.sharedImageCache removeImageFromDiskForKey:kTestJPEGURL]; [SDImageCache.sharedImageCache removeImageFromMemoryForKey:firstImageUrl.absoluteString];
[SDImageCache.sharedImageCache removeImageFromMemoryForKey:kTestPNGURL]; [SDImageCache.sharedImageCache removeImageFromDiskForKey:firstImageUrl.absoluteString];
[SDImageCache.sharedImageCache removeImageFromMemoryForKey:secondImageUrl.absoluteString];
[SDImageCache.sharedImageCache removeImageFromDiskForKey:secondImageUrl.absoluteString];
// Next, lets put our second image into memory, so that the next time // Next, lets put our second image into memory, so that the next time
// we load it, it will come from memory, and thus shouldUseTransition will be NO // we load it, it will come from memory, and thus shouldUseTransition will be NO