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

Method FileLocationSetFile2

test/testerrorlogger.cpp:239–248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

237 }
238
239 void FileLocationSetFile2() const {
240 ErrorMessage::FileLocation loc("foo1.cpp", SuppressionList::Suppression::NO_LINE, 0); // TODO: should not depend on Suppression
241 loc.setfile("foo.cpp");
242 ASSERT_EQUALS("foo1.cpp", loc.getOrigFile(false));
243 ASSERT_EQUALS("foo.cpp", loc.getfile(false));
244 ASSERT_EQUALS(SuppressionList::Suppression::NO_LINE, loc.line);
245 ASSERT_EQUALS(0, loc.column);
246 ASSERT_EQUALS("[foo.cpp]", loc.stringify(false));
247 ASSERT_EQUALS("[foo.cpp]", loc.stringify(true));
248 }
249
250 void ErrorMessageConstruct() const {
251 std::list<ErrorMessage::FileLocation> locs(1, fooCpp5);

Callers

nothing calls this directly

Calls 4

setfileMethod · 0.80
getfileMethod · 0.80
getOrigFileMethod · 0.45
stringifyMethod · 0.45

Tested by

no test coverage detected