null pointers: Added a todo testcase
This commit is contained in:
parent
347802f819
commit
228e926654
|
@ -436,6 +436,19 @@ private:
|
|||
" tok = tok->next();\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("[test.cpp:4]: (error) Possible null pointer dereference\n", errout.str());
|
||||
|
||||
checkNullPointer("void foo()\n"
|
||||
"{\n"
|
||||
" for (const Token *tok = tokens; tok; tok = tok->next())\n"
|
||||
" {\n"
|
||||
" while (tok && tok->str() != \";\")\n"
|
||||
" tok = tok->next();\n"
|
||||
" }\n"
|
||||
"}\n");
|
||||
// Actual result:
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
// Expected (todo) result:
|
||||
TODO_ASSERT_EQUALS("[test.cpp:3]: (error) Possible null pointer dereference\n", errout.str());
|
||||
}
|
||||
|
||||
void nullpointer2()
|
||||
|
|
Loading…
Reference in New Issue