Memory leak : Added a test case for false positive when using function call

This commit is contained in:
Daniel Marjamäki 2008-12-13 10:01:05 +00:00
parent e99744ae9b
commit 46205bde8e
1 changed files with 20 additions and 2 deletions

View File

@ -117,6 +117,7 @@ private:
TEST_CASE( func6 ); TEST_CASE( func6 );
// TODO TEST_CASE( func7 ); // TODO TEST_CASE( func7 );
TEST_CASE( func8 ); // Using callback TEST_CASE( func8 ); // Using callback
// TODO TEST_CASE( func9 ); // Embedding the function call in a if-condition
TEST_CASE( class1 ); TEST_CASE( class1 );
TEST_CASE( class2 ); TEST_CASE( class2 );
@ -842,6 +843,23 @@ private:
} }
void func9()
{
check( "int b()\n"
"{\n"
" return 0;\n"
"}\n"
"\n"
"void a()\n"
"{\n"
" char *a = new char[10];\n"
" if (b())\n"
" return;\n"
" delete [] a;\n"
"}\n" );
ASSERT_EQUALS( std::string(""), errout.str() );
}
/* /*
void func3() void func3()