From 97a7bc383d18ed6a55d3fbc2e644f35b69fb2af1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Wed, 14 Jan 2009 16:40:07 +0000 Subject: [PATCH] memory leak: Added test case --- test/testmemleak.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/testmemleak.cpp b/test/testmemleak.cpp index f991a5db5..64d9bbc12 100644 --- a/test/testmemleak.cpp +++ b/test/testmemleak.cpp @@ -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()); + } +