Memory leak: Renamed the test case "func12" to "if9"
This commit is contained in:
parent
0c2f90dceb
commit
cc569d164d
|
@ -91,8 +91,7 @@ private:
|
||||||
TEST_CASE( if6 ); // Bug 2432631
|
TEST_CASE( if6 ); // Bug 2432631
|
||||||
TEST_CASE( if7 ); // Bug 2401436
|
TEST_CASE( if7 ); // Bug 2401436
|
||||||
TEST_CASE( if8 ); // Bug 2458532
|
TEST_CASE( if8 ); // Bug 2458532
|
||||||
|
//TODO TEST_CASE( if9 );
|
||||||
TEST_CASE( alwaysTrue );
|
|
||||||
|
|
||||||
TEST_CASE( forwhile1 );
|
TEST_CASE( forwhile1 );
|
||||||
TEST_CASE( forwhile2 );
|
TEST_CASE( forwhile2 );
|
||||||
|
@ -127,7 +126,6 @@ private:
|
||||||
TEST_CASE( func9 ); // Embedding the function call in a if-condition
|
TEST_CASE( func9 ); // Embedding the function call in a if-condition
|
||||||
TEST_CASE( func10 ); // Bug 2458510 - Function pointer
|
TEST_CASE( func10 ); // Bug 2458510 - Function pointer
|
||||||
TEST_CASE( func11 ); // Bug 2458510 - Function pointer
|
TEST_CASE( func11 ); // Bug 2458510 - Function pointer
|
||||||
// TODO TEST_CASE( func12 );
|
|
||||||
|
|
||||||
TEST_CASE( class1 );
|
TEST_CASE( class1 );
|
||||||
TEST_CASE( class2 );
|
TEST_CASE( class2 );
|
||||||
|
@ -577,31 +575,29 @@ private:
|
||||||
ASSERT_EQUALS( std::string("[test.cpp:11]: Memory leak: c\n"), errout.str() );
|
ASSERT_EQUALS( std::string("[test.cpp:11]: Memory leak: c\n"), errout.str() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void if9()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void alwaysTrue()
|
|
||||||
{
|
{
|
||||||
check( "void f()\n"
|
check( "static void f()\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
" char *p = 0;\n"
|
" char *buf = NULL, *tmp;\n"
|
||||||
" for (;;)\n"
|
" if (!(tmp = realloc(buf, 50)))\n"
|
||||||
" {\n"
|
" {\n"
|
||||||
" p = malloc(256);\n"
|
" free(buf);\n"
|
||||||
" if (1)\n"
|
" return NULL;\n"
|
||||||
" break;\n"
|
|
||||||
" }\n"
|
" }\n"
|
||||||
" free(p);\n"
|
" buf = tmp;\n"
|
||||||
|
" return buf;\n"
|
||||||
"}\n" );
|
"}\n" );
|
||||||
std::string err( errout.str() );
|
ASSERT_EQUALS( std::string(""), errout.str() );
|
||||||
ASSERT_EQUALS( std::string(""), err );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void forwhile1()
|
void forwhile1()
|
||||||
{
|
{
|
||||||
check("void f()\n"
|
check("void f()\n"
|
||||||
|
@ -1024,22 +1020,6 @@ private:
|
||||||
ASSERT_EQUALS( std::string(""), errout.str() );
|
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()
|
void func3()
|
||||||
|
|
Loading…
Reference in New Issue