diff --git a/Tests/Tests/SDAnimatedImageTest.m b/Tests/Tests/SDAnimatedImageTest.m index 6b9a8b82..450f611e 100644 --- a/Tests/Tests/SDAnimatedImageTest.m +++ b/Tests/Tests/SDAnimatedImageTest.m @@ -352,13 +352,19 @@ static BOOL _isCalled; - (void)test24AnimatedImageViewCategoryDiskCache { XCTestExpectation *expectation = [self expectationWithDescription:@"test SDAnimatedImageView view category disk cache"]; SDAnimatedImageView *imageView = [SDAnimatedImageView new]; - NSURL *testURL = [NSURL URLWithString:kTestGIFURL]; - [SDImageCache.sharedImageCache removeImageFromMemoryForKey:testURL.absoluteString]; + NSURL *testURL = [NSURL URLWithString:@"https://foobar.non-exists.org/bizbuz.gif"]; + NSString *testKey = testURL.absoluteString; + [SDImageCache.sharedImageCache removeImageFromMemoryForKey:testKey]; + [SDImageCache.sharedImageCache removeImageFromDiskForKey:testKey]; + NSData *imageData = [self testGIFData]; + [SDImageCache.sharedImageCache storeImageDataToDisk:imageData forKey:testKey]; [imageView sd_setImageWithURL:testURL placeholderImage:nil completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) { expect(error).to.beNil(); expect(image).notTo.beNil(); expect(cacheType).equal(SDImageCacheTypeDisk); expect([image isKindOfClass:[SDAnimatedImage class]]).beTruthy(); + [SDImageCache.sharedImageCache removeImageFromMemoryForKey:testKey]; + [SDImageCache.sharedImageCache removeImageFromDiskForKey:testKey]; [expectation fulfill]; }]; [self waitForExpectationsWithCommonTimeout]; diff --git a/Tests/Tests/SDUtilsTests.m b/Tests/Tests/SDUtilsTests.m index 4d61e6e7..0d4e628c 100644 --- a/Tests/Tests/SDUtilsTests.m +++ b/Tests/Tests/SDUtilsTests.m @@ -123,11 +123,7 @@ #endif expect(format.scale).equal(screenScale); expect(format.opaque).beFalsy(); -#if SD_UIKIT expect(format.preferredRange).equal(SDGraphicsImageRendererFormatRangeAutomatic); -#elif SD_MAC - expect(format.preferredRange).equal(SDGraphicsImageRendererFormatRangeStandard); -#endif CGSize size = CGSizeMake(100, 100); SDGraphicsImageRenderer *renderer = [[SDGraphicsImageRenderer alloc] initWithSize:size format:format]; #if SD_MAC