Check nullpointer check is now executed without --style flag

Added TODO test case for nullpointer check
This commit is contained in:
Reijo Tomperi 2009-09-29 16:38:05 +03:00
parent 64f0f3b308
commit 63523316a2
2 changed files with 10 additions and 1 deletions

View File

@ -47,12 +47,12 @@ public:
{ {
CheckOther checkOther(tokenizer, settings, errorLogger); CheckOther checkOther(tokenizer, settings, errorLogger);
checkOther.nullPointer();
if (settings->_checkCodingStyle) if (settings->_checkCodingStyle)
{ {
checkOther.warningOldStylePointerCast(); checkOther.warningOldStylePointerCast();
checkOther.checkUnsignedDivision(); checkOther.checkUnsignedDivision();
checkOther.checkCharVariable(); checkOther.checkCharVariable();
checkOther.nullPointer();
} }
} }

View File

@ -774,6 +774,15 @@ private:
"}\n"); "}\n");
ASSERT_EQUALS("", errout.str()); ASSERT_EQUALS("", errout.str());
checkNullPointer("void foo(P *p)\n"
"{\n"
" while (p)\n"
" if (p->check())\n"
" break;\n"
" else\n"
" p = p->next();\n"
"}\n");
TODO_ASSERT_EQUALS("", errout.str());
} }