Memory leak: Added TODO test. Mismatching allocation and deallocation in subfunction

This commit is contained in:
Daniel Marjamäki 2008-11-11 20:03:06 +00:00
parent 57c144a342
commit 0c910c9775
1 changed files with 18 additions and 0 deletions

View File

@ -105,6 +105,7 @@ private:
TEST_CASE( func2 );
TEST_CASE( func3 );
TEST_CASE( func4 );
// TODO TEST_CASE( func5 );
TEST_CASE( class1 );
TEST_CASE( class2 );
@ -667,6 +668,23 @@ private:
}
void func5()
{
// TODO
check( "static void foo(char *str)\n"
"{\n"
" delete str;\n"
"}\n"
"\n"
"static void f()\n"
"{\n"
" char *p = new char[100];\n"
" foo(p);\n"
"}\n" );
ASSERT_EQUALS( std::string("mismatching allocation and deallocation"), errout.str() );
}
/*
void func3()