Memory leaks: Added a simple todo test case

This commit is contained in:
Daniel Marjamäki 2009-07-06 12:33:31 +02:00
parent 9beb73824b
commit 5efb834f36
1 changed files with 12 additions and 0 deletions

View File

@ -129,6 +129,7 @@ private:
TEST_CASE(simple9); // Bug 2435468 - member function "free"
TEST_CASE(simple10); // fclose in a if condition
TEST_CASE(simple11);
TEST_CASE(simple12);
TEST_CASE(new_nothrow);
TEST_CASE(staticvar);
@ -435,6 +436,17 @@ private:
ASSERT_EQUALS("", errout.str());
}
void simple12()
{
check("void f()\n"
"{\n"
" char *s;\n"
" foo(s);\n"
" s = malloc(100);\n"
"}\n");
ASSERT_EQUALS("[test.cpp:6]: (error) Memory leak: s\n", errout.str());
}
void new_nothrow()