added a todo testcase for ticket 1778

This commit is contained in:
Martin Ettl 2010-06-09 01:21:52 +02:00
parent 00dcec47ac
commit c9cd5ea250
1 changed files with 11 additions and 0 deletions

View File

@ -69,6 +69,7 @@ private:
TEST_CASE(nullpointer6);
TEST_CASE(nullpointer7);
TEST_CASE(nullpointer8);
TEST_CASE(nullpointer9);
TEST_CASE(uninitvar1);
TEST_CASE(uninitvar_alloc); // data is allocated but not initialized
@ -1151,6 +1152,16 @@ private:
ASSERT_EQUALS("[test.cpp:4]: (error) Possible null pointer dereference: x\n", errout.str());
}
void nullpointer9() //#ticket 1778
{
checkNullPointer("void foo()\n"
"{\n"
" std::string * x = 0;\n"
" *x = \"test\";\n"
"}\n");
TODO_ASSERT_EQUALS("[test.cpp:4]: (error) Possible null pointer dereference: x\n", errout.str());
}
void checkUninitVar(const char code[])
{
// Tokenize..