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

Method MockUnexpectedOutputParameterFailure

src/CppUTestExt/MockFailure.cpp:167–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

165}
166
167MockUnexpectedOutputParameterFailure::MockUnexpectedOutputParameterFailure(UtestShell* test, const SimpleString& functionName, const MockNamedValue& parameter, const MockExpectedCallsList& expectations) : MockFailure(test)
168{
169 MockExpectedCallsList expectationsForFunctionWithParameterName;
170 expectationsForFunctionWithParameterName.addExpectationsRelatedTo(functionName, expectations);
171 expectationsForFunctionWithParameterName.onlyKeepExpectationsWithOutputParameterName(parameter.getName());
172
173 if (expectationsForFunctionWithParameterName.isEmpty()) {
174 message_ = "Mock Failure: Unexpected output parameter name to function \"";
175 message_ += functionName;
176 message_ += "\": ";
177 message_ += parameter.getName();
178 }
179 else {
180 message_ = "Mock Failure: Unexpected parameter type \"";
181 message_ += parameter.getType();
182 message_ += "\" to output parameter \"";
183 message_ += parameter.getName();
184 message_ += "\" to function \"";
185 message_ += functionName;
186 message_ += "\"";
187 }
188
189 message_ += "\n";
190 addExpectationsAndCallHistoryRelatedTo(functionName, expectations);
191
192 message_ += "\n\tACTUAL unexpected output parameter passed to function: ";
193 message_ += functionName;
194 message_ += "\n";
195
196 message_ += "\t\t";
197 message_ += parameter.getType();
198 message_ += " ";
199 message_ += parameter.getName();
200}
201
202MockExpectedParameterDidntHappenFailure::MockExpectedParameterDidntHappenFailure(UtestShell* test, const SimpleString& functionName, const MockExpectedCallsList& expectations) : MockFailure(test)
203{

Callers

nothing calls this directly

Calls 5

getTypeMethod · 0.80
getNameMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected