From b95b390f17f7bae7922cbaad7ddc3fa08e04ed74 Mon Sep 17 00:00:00 2001 From: DreamPiggy Date: Wed, 10 Jan 2024 15:38:55 +0800 Subject: [PATCH] Update the unit test Fix the `testUIViewCancelCurrentImageLoadWithTransition` --- Tests/Tests/SDWebCacheCategoriesTests.m | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Tests/Tests/SDWebCacheCategoriesTests.m b/Tests/Tests/SDWebCacheCategoriesTests.m index e4943c35..60c1e08e 100644 --- a/Tests/Tests/SDWebCacheCategoriesTests.m +++ b/Tests/Tests/SDWebCacheCategoriesTests.m @@ -344,12 +344,14 @@ - (void)testUIViewCancelCurrentImageLoadWithTransition { UIView *imageView = [[UIView alloc] init]; - NSURL *firstImageUrl = [NSURL URLWithString:kTestJPEGURL]; - NSURL *secondImageUrl = [NSURL URLWithString:kTestPNGURL]; + NSURL *firstImageUrl = [NSURL URLWithString:@"https://placehold.co/201x201.jpg"]; + NSURL *secondImageUrl = [NSURL URLWithString:@"https://placehold.co/201x201.png"]; // First, reset our caches - [SDImageCache.sharedImageCache removeImageFromDiskForKey:kTestJPEGURL]; - [SDImageCache.sharedImageCache removeImageFromMemoryForKey:kTestPNGURL]; + [SDImageCache.sharedImageCache removeImageFromMemoryForKey:firstImageUrl.absoluteString]; + [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 // we load it, it will come from memory, and thus shouldUseTransition will be NO