diff --git a/Tests/Tests/SDImageCoderTests.m b/Tests/Tests/SDImageCoderTests.m index 75b6a992..fe47af5a 100644 --- a/Tests/Tests/SDImageCoderTests.m +++ b/Tests/Tests/SDImageCoderTests.m @@ -541,6 +541,8 @@ #if SD_UIKIT UIImageOrientation orientation = image.imageOrientation; expect(orientation).equal(UIImageOrientationUp); +#else + expect(image.sd_imageFormat).equal(SDImageFormatJPEG); #endif // Manual test again for Apple's API diff --git a/Tests/Tests/SDWebImageDownloaderTests.m b/Tests/Tests/SDWebImageDownloaderTests.m index e80ffa92..7ec548c5 100644 --- a/Tests/Tests/SDWebImageDownloaderTests.m +++ b/Tests/Tests/SDWebImageDownloaderTests.m @@ -825,14 +825,17 @@ [self waitForExpectations:expectations timeout:kAsyncTestTimeout * 2]; } - - (void)test31ThatMultipleRequestForSameURLFailedCallback { // See #3493, silly bug - NSURL *url = [NSURL fileURLWithPath:@"/dev/null"]; // Always fail url - NSMutableArray *expectations = [NSMutableArray arrayWithCapacity:100]; + // Create tmp file with empty contents + NSURL *dir = [[NSURL fileURLWithPath:NSTemporaryDirectory()] URLByAppendingPathComponent:NSStringFromSelector(_cmd) isDirectory: true]; + [NSFileManager.defaultManager createDirectoryAtURL:dir withIntermediateDirectories:YES attributes:nil error:nil]; + NSURL *url = [dir URLByAppendingPathComponent:@"file" isDirectory:NO]; + [[NSData data] writeToURL:url atomically:YES]; // Always fail url (but valid) + NSMutableArray *expectations = [NSMutableArray arrayWithCapacity:10]; __block void (^recursiveBlock)(int); void (^mainBlock)(int) = ^(int i) { - if (i > 200) return; + if (i > 10) return; NSString *desc = [NSString stringWithFormat:@"Failed url with index %d should callback error", i]; XCTestExpectation *expectation = [self expectationWithDescription:desc]; [expectations addObject:expectation]; @@ -853,7 +856,6 @@ [self waitForExpectations:expectations timeout:kAsyncTestTimeout * 2]; } - #pragma mark - SDWebImageLoader - (void)testCustomImageLoaderWorks { XCTestExpectation *expectation = [self expectationWithDescription:@"Custom image not works"];