Created to testcase (#2368) for assigned a value that is never used false positive

This commit is contained in:
Ettl Martin 2010-12-27 15:12:17 +01:00
parent 660de98c0c
commit ccde32b210
1 changed files with 21 additions and 0 deletions

View File

@ -81,6 +81,7 @@ private:
TEST_CASE(localvar31); // ticket #2286
TEST_CASE(localvar32); // ticket #2330
TEST_CASE(localvar33); // ticket #2346
TEST_CASE(localvar34); // ticket #2368
TEST_CASE(localvaralias1);
TEST_CASE(localvaralias2); // ticket #1637
TEST_CASE(localvaralias3); // ticket #1639
@ -1358,6 +1359,26 @@ private:
ASSERT_EQUALS("", errout.str());
}
void localvar34() // ticket #2368
{
functionVariableUsage("int f(void) {\n"
" int i = 0;\n"
" int j = 3;\n"
" if (false) {\n"
" }\n"
" else {\n"
" j -= i;\n"
" }\n"
" if (false) {\n"
" }\n"
" else {\n"
" j -= i;\n"
" }\n"
" return j;\n"
"}\n");
TODO_ASSERT_EQUALS("", errout.str());
}
void localvaralias1()
{
functionVariableUsage("void foo()\n"