Memory leak : Add a new test that currently fail to highlight a regression

This commit is contained in:
Nicolas Le Cam 2009-01-02 01:29:07 +00:00
parent e29ead375f
commit 0c2f90dceb
1 changed files with 17 additions and 0 deletions

View File

@ -127,6 +127,7 @@ private:
TEST_CASE( func9 ); // Embedding the function call in a if-condition
TEST_CASE( func10 ); // Bug 2458510 - Function pointer
TEST_CASE( func11 ); // Bug 2458510 - Function pointer
// TODO TEST_CASE( func12 );
TEST_CASE( class1 );
TEST_CASE( class2 );
@ -1023,6 +1024,22 @@ private:
ASSERT_EQUALS( std::string(""), errout.str() );
}
void func12()
{
check( "static void f()\n"
"{\n"
" char *buf = NULL, *tmp;\n"
" if (!(tmp = realloc(buf, 50)))\n"
" {\n"
" free(buf);\n"
" return NULL;\n"
" }\n"
" buf = tmp;\n"
" return buf;\n"
"}\n" );
ASSERT_EQUALS( std::string(""), errout.str() );
}
/*
void func3()