MCPcopy Create free account
hub / github.com/cpputest/cpputest / checkExpectations

Method checkExpectations

src/CppUTestExt/MockActualCall.cpp:372–408  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

370}
371
372void MockCheckedActualCall::checkExpectations()
373{
374 if(expectationsChecked_) {
375 return;
376 }
377
378 expectationsChecked_ = true;
379
380 if (state_ != CALL_IN_PROGRESS) {
381 if(state_ == CALL_SUCCEED) {
382 matchingExpectation_->callWasMade(callOrder_);
383 }
384 potentiallyMatchingExpectations_.resetActualCallMatchingState();
385 return;
386 }
387
388 if (potentiallyMatchingExpectations_.hasFinalizedMatchingExpectations())
389 FAIL("Actual call is in progress, but there are finalized matching expectations when checking expectations. This cannot happen."); // LCOV_EXCL_LINE
390
391 matchingExpectation_ = potentiallyMatchingExpectations_.removeFirstMatchingExpectation();
392 if (matchingExpectation_) {
393 matchingExpectation_->finalizeActualCallMatch();
394 callHasSucceeded();
395 matchingExpectation_->callWasMade(callOrder_);
396 potentiallyMatchingExpectations_.resetActualCallMatchingState();
397 return;
398 }
399
400 if (potentiallyMatchingExpectations_.hasUnmatchingExpectationsBecauseOfMissingParameters()) {
401 MockExpectedParameterDidntHappenFailure failure(getTest(), getName(), allExpectations_);
402 failTest(failure);
403 }
404 else {
405 MockExpectedObjectDidntHappenFailure failure(getTest(), getName(), allExpectations_);
406 failTest(failure);
407 }
408}
409
410void MockCheckedActualCall::setState(ActualCallState state)
411{

Callers

nothing calls this directly

Tested by

no test coverage detected