variable usage: added a test case to make sure usage in a if is seen

This commit is contained in:
Daniel Marjamäki 2009-01-04 17:09:55 +00:00
parent 445230f3ae
commit 76e2aea0f5
1 changed files with 13 additions and 0 deletions

View File

@ -65,6 +65,7 @@ private:
TEST_CASE( localvar6 );
TEST_CASE( localvarMod ); // Usage with modulo
TEST_CASE( localvarIf ); // Usage in if
}
void structmember1()
@ -210,6 +211,18 @@ private:
ASSERT_EQUALS( std::string(""), errout.str() );
}
void localvarIf()
{
functionVariableUsage( "int main()\n"
"{\n"
" int tmp = 10;\n"
" if ( tmp )\n"
" return 1;\n"
" return 0;\n"
"}\n" );
ASSERT_EQUALS( std::string(""), errout.str() );
}
};