Update the test case
This commit is contained in:
parent
ecedea2e06
commit
0df663ca95
|
@ -352,13 +352,19 @@ static BOOL _isCalled;
|
||||||
- (void)test24AnimatedImageViewCategoryDiskCache {
|
- (void)test24AnimatedImageViewCategoryDiskCache {
|
||||||
XCTestExpectation *expectation = [self expectationWithDescription:@"test SDAnimatedImageView view category disk cache"];
|
XCTestExpectation *expectation = [self expectationWithDescription:@"test SDAnimatedImageView view category disk cache"];
|
||||||
SDAnimatedImageView *imageView = [SDAnimatedImageView new];
|
SDAnimatedImageView *imageView = [SDAnimatedImageView new];
|
||||||
NSURL *testURL = [NSURL URLWithString:kTestGIFURL];
|
NSURL *testURL = [NSURL URLWithString:@"https://foobar.non-exists.org/bizbuz.gif"];
|
||||||
[SDImageCache.sharedImageCache removeImageFromMemoryForKey:testURL.absoluteString];
|
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) {
|
[imageView sd_setImageWithURL:testURL placeholderImage:nil completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {
|
||||||
expect(error).to.beNil();
|
expect(error).to.beNil();
|
||||||
expect(image).notTo.beNil();
|
expect(image).notTo.beNil();
|
||||||
expect(cacheType).equal(SDImageCacheTypeDisk);
|
expect(cacheType).equal(SDImageCacheTypeDisk);
|
||||||
expect([image isKindOfClass:[SDAnimatedImage class]]).beTruthy();
|
expect([image isKindOfClass:[SDAnimatedImage class]]).beTruthy();
|
||||||
|
[SDImageCache.sharedImageCache removeImageFromMemoryForKey:testKey];
|
||||||
|
[SDImageCache.sharedImageCache removeImageFromDiskForKey:testKey];
|
||||||
[expectation fulfill];
|
[expectation fulfill];
|
||||||
}];
|
}];
|
||||||
[self waitForExpectationsWithCommonTimeout];
|
[self waitForExpectationsWithCommonTimeout];
|
||||||
|
|
|
@ -123,11 +123,7 @@
|
||||||
#endif
|
#endif
|
||||||
expect(format.scale).equal(screenScale);
|
expect(format.scale).equal(screenScale);
|
||||||
expect(format.opaque).beFalsy();
|
expect(format.opaque).beFalsy();
|
||||||
#if SD_UIKIT
|
|
||||||
expect(format.preferredRange).equal(SDGraphicsImageRendererFormatRangeAutomatic);
|
expect(format.preferredRange).equal(SDGraphicsImageRendererFormatRangeAutomatic);
|
||||||
#elif SD_MAC
|
|
||||||
expect(format.preferredRange).equal(SDGraphicsImageRendererFormatRangeStandard);
|
|
||||||
#endif
|
|
||||||
CGSize size = CGSizeMake(100, 100);
|
CGSize size = CGSizeMake(100, 100);
|
||||||
SDGraphicsImageRenderer *renderer = [[SDGraphicsImageRenderer alloc] initWithSize:size format:format];
|
SDGraphicsImageRenderer *renderer = [[SDGraphicsImageRenderer alloc] initWithSize:size format:format];
|
||||||
#if SD_MAC
|
#if SD_MAC
|
||||||
|
|
Loading…
Reference in New Issue