Refactoring TestUninitVar. Added TODO test case.
This commit is contained in:
parent
1e1b20d113
commit
f59078fad9
|
@ -77,15 +77,6 @@ private:
|
|||
}
|
||||
|
||||
void uninitvar1() {
|
||||
|
||||
// Ticket #3597
|
||||
checkUninitVar("int f() {\n"
|
||||
" int a;\n"
|
||||
" int b = 1;\n"
|
||||
" (b += a) = 1;\n"
|
||||
"}\n");
|
||||
TODO_ASSERT_EQUALS("[test.cpp:4]: (error) Uninitialized variable: a\n","", errout.str());
|
||||
|
||||
// Ticket #2207 - False negative
|
||||
checkUninitVar("void foo() {\n"
|
||||
" int a;\n"
|
||||
|
@ -269,6 +260,20 @@ private:
|
|||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
// Ticket #3597
|
||||
checkUninitVar("int f() {\n"
|
||||
" int a;\n"
|
||||
" int b = 1;\n"
|
||||
" (b += a) = 1;\n"
|
||||
"}\n");
|
||||
TODO_ASSERT_EQUALS("[test.cpp:4]: (error) Uninitialized variable: a\n","", errout.str());
|
||||
|
||||
checkUninitVar("int f() {\n"
|
||||
" int a,b,c;\n"
|
||||
" a = b = c;\n"
|
||||
"}\n");
|
||||
TODO_ASSERT_EQUALS("[test.cpp:3]: (error) Uninitialized variable: c\n", "", errout.str());
|
||||
|
||||
checkUninitVar("static void foo()\n"
|
||||
"{\n"
|
||||
" Foo p;\n"
|
||||
|
|
Loading…
Reference in New Issue