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

Method CustomFormat2

test/testerrorlogger.cpp:399–407  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

397 }
398
399 void CustomFormat2() const {
400 std::list<ErrorMessage::FileLocation> locs(1, fooCpp5);
401 ErrorMessage msg(std::move(locs), "", Severity::error, "Programming error.\nVerbose error", "errorId", Certainty::normal);
402 ASSERT_EQUALS(1, msg.callStack.size());
403 ASSERT_EQUALS("Programming error.", msg.shortMessage());
404 ASSERT_EQUALS("Verbose error", msg.verboseMessage());
405 ASSERT_EQUALS("Programming error. - foo.cpp(5):(error,errorId)", msg.toString(false, "{message} - {file}({line}):({severity},{id})", ""));
406 ASSERT_EQUALS("Verbose error - foo.cpp(5):(error,errorId)", msg.toString(true, "{message} - {file}({line}):({severity},{id})", ""));
407 }
408
409 void CustomFormatLocations() const {
410 // Check that first location from location stack is used in template

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected