Updated expected fullfilment count of async calls in test
This commit is contained in:
parent
d2780e4251
commit
1ba8a79f80
|
@ -798,11 +798,12 @@ class ImageClassifierTests: XCTestCase {
|
|||
// expectation is not fullfilled for the specified `expectedFulfillmentCount`.
|
||||
// Since in our case we cannot predict how many times the expectation is
|
||||
// supposed to be fullfilled setting,
|
||||
// `expectation.expectedFulfillmentCount` = `iterationCount` and
|
||||
// `expectation.expectedFulfillmentCount` = `iterationCount` + 1 and
|
||||
// `expectation.isInverted = true` ensures that test succeeds if
|
||||
// expectation is not fullfilled `iterationCount` times.
|
||||
// expectation is fullfilled <= `iterationCount` times.
|
||||
let expectation = expectation(description: "liveStreamClassify")
|
||||
expectation.expectedFulfillmentCount = iterationCount;
|
||||
|
||||
expectation.expectedFulfillmentCount = iterationCount + 1;
|
||||
expectation.isInverted = true;
|
||||
|
||||
imageClassifierOptions.completion = {(
|
||||
|
|
|
@ -670,13 +670,13 @@ static NSString *const kExpectedErrorDomain = @"com.google.mediapipe.tasks";
|
|||
// expectation is not fullfilled for the specified `expectedFulfillmentCount`.
|
||||
// Since in our case we cannot predict how many times the expectation is
|
||||
// supposed to be fullfilled setting,
|
||||
// `expectation.expectedFulfillmentCount` = `iterationCount` and
|
||||
// `expectation.expectedFulfillmentCount` = `iterationCount` + 1 and
|
||||
// `expectation.isInverted = true` ensures that test succeeds if
|
||||
// expectation is not fullfilled `iterationCount` times.
|
||||
// expectation is fullfilled <= `iterationCount` times.
|
||||
XCTestExpectation *expectation =
|
||||
[[XCTestExpectation alloc] initWithDescription:@"classifyWithLiveStream"];
|
||||
|
||||
expectation.expectedFulfillmentCount = iterationCount;
|
||||
expectation.expectedFulfillmentCount = iterationCount + 1;
|
||||
expectation.inverted = YES;
|
||||
|
||||
options.runningMode = MPPRunningModeLiveStream;
|
||||
|
|
Loading…
Reference in New Issue
Block a user