#1880: added todo testcase (false positive: (error) Uninitialized variable: y)

This commit is contained in:
Martin Ettl 2010-07-18 18:55:53 +02:00
parent 5ab36d8a6d
commit 6cc3f76668
1 changed files with 10 additions and 0 deletions

View File

@ -1921,6 +1921,16 @@ private:
" strchr(s, ' ');\n"
"};\n");
ASSERT_EQUALS("[test.cpp:4]: (error) Uninitialized variable: s\n", errout.str());
checkUninitVar("void foo()\n"
"{\n"
" int y[2];\n"
" int s;\n"
" GetField( y + 0, \n"
" y + 1 );\n"
" s = y[0]*y[1];\n"
"}\n");
TODO_ASSERT_EQUALS("", errout.str());
}
// alloc..