#2773 added missing testcase

This commit is contained in:
Ettl Martin 2012-07-02 10:01:37 +02:00
parent 34fa95153a
commit 7401104f45
1 changed files with 16 additions and 1 deletions

View File

@ -225,6 +225,7 @@ private:
TEST_CASE(func24); // Ticket #2705
TEST_CASE(func25); // Ticket #2904
TEST_CASE(func26);
TEST_CASE(func27); // Ticket #2773
TEST_CASE(allocfunc1);
TEST_CASE(allocfunc2);
@ -2228,7 +2229,7 @@ private:
}
void func26() { // ticket #3444
// technically there is a leak here. however warning is not wanted
// technically there is a leak here. However warning is not wanted
check("void f() {\n"
" char *p = strdup(\"A=B\");\n"
" putenv(p);\n"
@ -2236,6 +2237,20 @@ private:
ASSERT_EQUALS("", errout.str());
}
void func27() { // ticket #2773
check("void f(FRED *pData)\n"
"{\n"
" pData =(FRED*)malloc( 100 );\n"
"}\n");
ASSERT_EQUALS("[test.cpp:4]: (error) Memory leak: pData\n", errout.str());
check("void f(int *pData)\n"
"{\n"
" pData =(int*)malloc( 100 );\n"
"}\n");
ASSERT_EQUALS("[test.cpp:4]: (error) Memory leak: pData\n", errout.str());
}
void allocfunc1() {
check("static char *a()\n"
"{\n"