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

Method MockUnexpectedCallHappenedFailure

src/CppUTestExt/MockFailure.cpp:104–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102}
103
104MockUnexpectedCallHappenedFailure::MockUnexpectedCallHappenedFailure(UtestShell* test, const SimpleString& name, const MockExpectedCallsList& expectations) : MockFailure(test)
105{
106 unsigned int amountOfActualCalls = expectations.amountOfActualCallsFulfilledFor(name);
107 if (amountOfActualCalls > 0) {
108 SimpleString ordinalNumber = StringFromOrdinalNumber(amountOfActualCalls + 1);
109 message_ = StringFromFormat("Mock Failure: Unexpected additional (%s) call to function: ", ordinalNumber.asCharString());
110 } else {
111 message_ = "Mock Failure: Unexpected call to function: ";
112 }
113 message_ += name;
114 message_ += "\n";
115 addExpectationsAndCallHistory(expectations);
116}
117
118MockCallOrderFailure::MockCallOrderFailure(UtestShell* test, const MockExpectedCallsList& expectations) : MockFailure(test)
119{

Callers

nothing calls this directly

Calls 4

StringFromOrdinalNumberFunction · 0.85
StringFromFormatFunction · 0.85
asCharStringMethod · 0.80

Tested by

no test coverage detected