|
|
@@ -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<XCTestExpectation *> *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<XCTestExpectation *> *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"];
|