MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / assertFailure

Method assertFailure

test/fixture.cpp:184–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

182}
183
184void TestFixture::assertFailure(const char* const filename, const unsigned int linenr, const std::string& expected, const std::string& actual, const std::string& msg) const
185{
186 ++fails_counter;
187 errmsg << getLocationStr(filename, linenr) << ": Assertion failed. " << std::endl
188 << "Expected: " << std::endl
189 << writestr(expected) << std::endl
190 << "Actual: " << std::endl
191 << writestr(actual) << std::endl;
192 if (!msg.empty())
193 errmsg << "Hint:" << std::endl << msg << std::endl;
194 errmsg << "_____" << std::endl;
195 throw AssertFailedError();
196}
197
198void TestFixture::assertEquals(const char * const filename, const unsigned int linenr, const std::string &expected, const std::string &actual, const std::string &msg) const
199{

Callers

nothing calls this directly

Calls 3

writestrFunction · 0.85
AssertFailedErrorClass · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected