void MockSupport::failTestWithOutOfOrderCalls() { MockExpectedCallsList expectationsList; expectationsList.addExpectations(expectations_); for(MockNamedValueListNode *p = data_.begin();p;p = p->next()) if(getMockSupport(p)) expectationsList.addExpectations(getMockSupport(p)->expectations_); MockCallOrderFailure failure(activeReporter_->getTestToFail(), expectationsList); clear(); failTest(failure); }
MockCallOrderFailure::MockCallOrderFailure(UtestShell* test, const MockExpectedCallsList& expectations) : MockFailure(test) { MockExpectedCallsList expectationsForOutOfOrder; expectationsForOutOfOrder.addExpectations(expectations); expectationsForOutOfOrder.onlyKeepOutOfOrderExpectations(); message_ = "Mock Failure: Out of order calls"; message_ += "\n"; addExpectationsAndCallHistory(expectationsForOutOfOrder); }