| 370 | } |
| 371 | |
| 372 | void 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 | |
| 410 | void MockCheckedActualCall::setState(ActualCallState state) |
| 411 | { |
nothing calls this directly
no test coverage detected