Update the test case because upstream changes

This commit is contained in:
DreamPiggy 2023-01-17 17:32:02 +08:00
parent 3af65409f2
commit b0a717871b
1 changed files with 2 additions and 2 deletions

View File

@ -193,9 +193,9 @@ const int64_t kAsyncTestTimeout = 5;
NSURL *staticWebPURL = [[NSBundle bundleForClass:[self class]] URLForResource:@"TestImageStatic" withExtension:@"webp"]; NSURL *staticWebPURL = [[NSBundle bundleForClass:[self class]] URLForResource:@"TestImageStatic" withExtension:@"webp"];
NSData *data = [NSData dataWithContentsOfURL:staticWebPURL]; NSData *data = [NSData dataWithContentsOfURL:staticWebPURL];
SDImageWebPCoder *coder = [[SDImageWebPCoder alloc] initWithAnimatedImageData:data options:nil]; SDImageWebPCoder *coder = [[SDImageWebPCoder alloc] initWithAnimatedImageData:data options:nil];
XCTAssertTrue(coder.animatedImageFrameCount == 1); XCTAssertTrue(coder.animatedImageFrameCount == 0);
UIImage *image = [coder animatedImageFrameAtIndex:0]; UIImage *image = [coder animatedImageFrameAtIndex:0];
XCTAssertNotNil(image); XCTAssertNil(image);
Ivar ivar = class_getInstanceVariable(coder.class, "_canvas"); Ivar ivar = class_getInstanceVariable(coder.class, "_canvas");
CGContextRef canvas = ((CGContextRef (*)(id, Ivar))object_getIvar)(coder, ivar); CGContextRef canvas = ((CGContextRef (*)(id, Ivar))object_getIvar)(coder, ivar);
XCTAssert(canvas == NULL); XCTAssert(canvas == NULL);