Test to close Ticket #1879

This commit is contained in:
seb777 2011-10-25 22:38:23 +02:00
parent 4b57a146fb
commit 1a6706005f
1 changed files with 15 additions and 0 deletions

View File

@ -343,6 +343,9 @@ private:
// #2662: segfault because of endless recursion (call_func -> getAllocationType -> functionReturnType -> call_func ..) // #2662: segfault because of endless recursion (call_func -> getAllocationType -> functionReturnType -> call_func ..)
TEST_CASE(trac2662); TEST_CASE(trac2662);
// #1879 non regression test case
TEST_CASE(trac1879);
} }
@ -3711,6 +3714,18 @@ private:
"}\n"); "}\n");
ASSERT_EQUALS("", errout.str()); ASSERT_EQUALS("", errout.str());
} }
void trac1879() {
// #1879 non regression test case
check("void test() {\n"
"int *a = new int[10];\n"
"try {}\n"
"catch(...) {}\n"
"}\n");
ASSERT_EQUALS("[test.cpp:5]: (error) Memory leak: a\n", errout.str());
}
}; };
static TestMemleakInFunction testMemleakInFunction; static TestMemleakInFunction testMemleakInFunction;