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

Method FileLocationSetFile

test/testerrorlogger.cpp:227–237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

225 }
226
227 void FileLocationSetFile() const {
228 ErrorMessage::FileLocation loc("foo1.cpp", 0, 0);
229 loc.setfile("foo.cpp");
230 ASSERT_EQUALS("foo1.cpp", loc.getOrigFile(false));
231 ASSERT_EQUALS("foo.cpp", loc.getfile(false));
232 ASSERT_EQUALS(0, loc.line);
233 ASSERT_EQUALS(0, loc.column);
234 // TODO: the following looks wrong - there is no line or column 0
235 ASSERT_EQUALS("[foo.cpp:0]", loc.stringify(false));
236 ASSERT_EQUALS("[foo.cpp:0:0]", loc.stringify(true));
237 }
238
239 void FileLocationSetFile2() const {
240 ErrorMessage::FileLocation loc("foo1.cpp", SuppressionList::Suppression::NO_LINE, 0); // TODO: should not depend on Suppression

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