Skip to content

Commit

Permalink
Add testHopeful for the NSURLSession related tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gcasa committed Dec 15, 2024
1 parent 3f27cb0 commit 4e69291
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Tests/base/NSURLSession/simpleTaskTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -841,6 +841,7 @@

NSLog(@"Test Server: baseURL=%@", baseURL);

testHopeful = YES;
[server setRoutes:createRoutes(routeClass, baseURL)];
[server resume];

Expand Down Expand Up @@ -873,6 +874,7 @@
[server suspend];
PASS(expectedCountOfTasksToComplete == currentCountOfCompletedTasks,
"All transfers were completed before a timeout occurred");
testHopeful = NO;

[server release];
[countLock release];
Expand All @@ -887,4 +889,4 @@
return 0;
}

#endif /* GS_HAVE_NSURLSESSION */
#endif /* GS_HAVE_NSURLSESSION */
4 changes: 3 additions & 1 deletion Tests/base/NSURLSession/uploadTaskTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ typedef void (^dataCompletionHandler)(NSData *data, NSURLResponse *response,
Class httpServerClass;
Class routeClass;

testHopeful = YES;
fm = [NSFileManager defaultManager];
currentDirectory = [fm currentDirectoryPath];
helperPath =
Expand Down Expand Up @@ -193,6 +194,7 @@ typedef void (^dataCompletionHandler)(NSData *data, NSURLResponse *response,

[server release];
[countLock release];
testHopeful = NO;
}
return 0;
}
Expand All @@ -205,4 +207,4 @@ typedef void (^dataCompletionHandler)(NSData *data, NSURLResponse *response,
return 0;
}

#endif
#endif

0 comments on commit 4e69291

Please sign in to comment.