Updated expected fullfilment count of async calls in test

This commit is contained in:
Prianka Liz Kariat 2023-03-30 22:22:24 +05:30
parent d2780e4251
commit 1ba8a79f80
2 changed files with 7 additions and 6 deletions

View File

@ -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 = {(

View File

@ -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;