added test case

This commit is contained in:
Daniel Marjamäki 2009-06-23 18:29:43 +02:00
parent df241441dc
commit 13ca5f89be
1 changed files with 18 additions and 0 deletions

View File

@ -255,6 +255,7 @@ private:
TEST_CASE(unknownFunction2);
TEST_CASE(unknownFunction3);
TEST_CASE(unknownFunction4);
TEST_CASE(unknownFunction5);
// VCL..
TEST_CASE(vcl1);
@ -1969,6 +1970,23 @@ private:
ASSERT_EQUALS("[test.cpp:5]: (error) Memory leak: p\n", errout.str());
}
void unknownFunction5()
{
check("static void foo()\n"
"{\n"
" char *p = NULL;\n"
"\n"
" if( a )\n"
" p = malloc(100);\n"
"\n"
" if( a )\n"
" {\n"
" FREENULL(p);\n"
" FREENULL();\n"
" }\n"
"}\n");
ASSERT_EQUALS("", errout.str());
}
void checkvcl(const char code[], const char _autoDealloc[])