Added TODO test case TestMemleak::stdstring

This commit is contained in:
Reijo Tomperi 2009-05-12 22:04:49 +03:00
parent 24d96b188e
commit 31f315d2ec
1 changed files with 14 additions and 1 deletions

View File

@ -212,7 +212,7 @@ private:
// Using the function "exit"
TEST_CASE(exit1);
TEST_CASE(exit2);
TEST_CASE(stdstring);
}
@ -2152,6 +2152,19 @@ private:
"}\n");
ASSERT_EQUALS(std::string(""), errout.str());
}
void stdstring()
{
check("void f(std::string foo)\n"
"{\n"
" char *out = new char[11];\n"
" memset(&(out[0]), 0, 1);\n"
"}\n");
std::string err(errout.str());
TODO_ASSERT_EQUALS(std::string("[test.cpp:5]: (error) Memory leak: out\n"), err);
}
};
REGISTER_TEST(TestMemleak)