Added todo testcase for ticket #2705

This commit is contained in:
Ettl Martin 2011-04-04 23:29:18 +02:00
parent f498e53cd2
commit af632a6aa0
1 changed files with 18 additions and 0 deletions

View File

@ -231,6 +231,7 @@ private:
TEST_CASE(func21); // Ticket #2569 TEST_CASE(func21); // Ticket #2569
TEST_CASE(func22); // Ticket #2668 TEST_CASE(func22); // Ticket #2668
TEST_CASE(func23); // Ticket #2667 TEST_CASE(func23); // Ticket #2667
TEST_CASE(func24); // Ticket #2705
TEST_CASE(allocfunc1); TEST_CASE(allocfunc1);
TEST_CASE(allocfunc2); TEST_CASE(allocfunc2);
@ -2181,6 +2182,23 @@ private:
ASSERT_EQUALS("", errout.str()); ASSERT_EQUALS("", errout.str());
} }
// #2705
void func24()
{
check("void f(void) \n"
"{\n"
" std::string *x = new std::string;\n"
"}\n");
TODO_ASSERT_EQUALS("[test.cpp:3]: (error) Memory leak: x\n","", errout.str());
check("void f(void) \n"
"{\n"
" std::string *x = new std::string;\n"
" delete x;\n"
"}\n");
ASSERT_EQUALS("", errout.str());
}
void allocfunc1() void allocfunc1()
{ {
check("static char *a()\n" check("static char *a()\n"