memory leak: Added test case
This commit is contained in:
parent
2d58b2b9ee
commit
97a7bc383d
|
@ -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());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue