CheckCondition: Fix TODO assertion

This commit is contained in:
Daniel Marjamäki 2017-09-06 22:53:36 +02:00
parent 4c30a5af25
commit f2d56363d3
1 changed files with 3 additions and 2 deletions

View File

@ -1813,13 +1813,14 @@ private:
"}\n");
ASSERT_EQUALS("", errout.str());
check("void C::f(const Tree &coreTree) {\n"
check("struct C { void f(const Tree &coreTree); };\n"
"void C::f(const Tree &coreTree) {\n"
" if(!coreTree.build())\n"
" return;\n"
" coreTree.dostuff();\n"
" if(!coreTree.build()) {}\n"
"}\n");
TODO_ASSERT_EQUALS("error", "", errout.str());
ASSERT_EQUALS("[test.cpp:3] -> [test.cpp:6]: (warning) Same condition '!coreTree.build()', second condition is always false\n", errout.str());
}
// clarify conditions with = and comparison