diff --git a/test/testmemleak.cpp b/test/testmemleak.cpp index 90ae1f40d..a5e5d7697 100644 --- a/test/testmemleak.cpp +++ b/test/testmemleak.cpp @@ -152,6 +152,8 @@ private: TEST_CASE(class7); TEST_CASE(class8); TEST_CASE(class9); + // TODO TEST_CASE(class10); + // TODO TEST_CASE(class11); TEST_CASE(throw1); TEST_CASE(throw2); @@ -1515,6 +1517,30 @@ private: ASSERT_EQUALS("", errout.str()); } + void class10() + { + check("class A\n" + "{\n" + "public:\n" + " int * p;\n" + " A() { p = new int; }\n" + "};\n", true); + ASSERT_EQUALS("memory leak", errout.str()); + } + + void class11() + { + check("class A\n" + "{\n" + "public:\n" + " int * p;\n" + " A();\n" + "};\n" + "A::A() : p(new int[10])\n" + "{ }", true); + ASSERT_EQUALS("memory leak", errout.str()); + } +