value flow: use checknullpointer checking based on new value flow analysis in the TestNullPointer

This commit is contained in:
Daniel Marjamäki 2014-01-12 19:51:05 +01:00
parent 8b6f001f94
commit c9e9262682
1 changed files with 2 additions and 2 deletions

View File

@ -86,7 +86,7 @@ private:
Settings settings; Settings settings;
settings.addEnabled("warning"); settings.addEnabled("warning");
settings.inconclusive = inconclusive; settings.inconclusive = inconclusive;
//settings.valueFlow = true; settings.valueFlow = true;
// cfg // cfg
const char cfg[] = "<?xml version=\"1.0\"?>\n" const char cfg[] = "<?xml version=\"1.0\"?>\n"
@ -560,7 +560,7 @@ private:
" if (*p == 0) { }\n" " if (*p == 0) { }\n"
" if (!p) { }\n" " if (!p) { }\n"
"}"); "}");
TODO_ASSERT_EQUALS("[test.cpp:3] -> [test.cpp:4]: (warning) Possible null pointer dereference: p - otherwise it is redundant to check it against null.\n", "", errout.str()); ASSERT_EQUALS("[test.cpp:3] -> [test.cpp:4]: (warning) Possible null pointer dereference: p - otherwise it is redundant to check it against null.\n", errout.str());
// no error // no error
check("void foo()\n" check("void foo()\n"