memory leak: Added test case

This commit is contained in:
Daniel Marjamäki 2009-01-14 16:40:07 +00:00
parent 2d58b2b9ee
commit 97a7bc383d
1 changed files with 18 additions and 0 deletions

View File

@ -136,6 +136,7 @@ private:
// TODO TEST_CASE( class3 );
TEST_CASE(class4);
TEST_CASE(class5);
TEST_CASE(class6);
TEST_CASE(throw1);
TEST_CASE(throw2);
@ -1272,6 +1273,23 @@ private:
ASSERT_EQUALS("[test.cpp:10]: Memory leak: str\n", errout.str());
}
void class6()
{
check("class Fred\n"
"{\n"
"public:\n"
" void foo();\n"
"};\n"
"\n"
"void Fred::foo()\n"
"{\n"
" char *str = new char[100];\n"
" delete [] str;\n"
" hello();\n"
"}\n");
ASSERT_EQUALS("", errout.str());
}