variable usage: added a test case to make sure usage in a if is seen
This commit is contained in:
parent
445230f3ae
commit
76e2aea0f5
|
@ -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() );
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue