added a testcase for ticket #1879

This commit is contained in:
Martin Ettl 2010-07-18 15:13:48 +02:00
parent 1fb4758583
commit 5ab36d8a6d
1 changed files with 16 additions and 0 deletions

View File

@ -40,6 +40,7 @@ private:
TEST_CASE(test2);
TEST_CASE(test3);
TEST_CASE(test4);
TEST_CASE(test5);
}
void check(const char code[])
@ -104,6 +105,21 @@ private:
"}\n");
ASSERT_EQUALS("", errout.str());
}
void test5() //#ticket 1879
{
check("void test()\n"
"{\n"
" int *a = new int[10];\n"
" try\n"
" {\n"
" }\n"
" catch(...)\n"
" {\n"
" }\n"
"}\n");
ASSERT_EQUALS("[test.cpp:10]: (error) Memory leak: a\n",errout.str());
}
};
static TestLocalLeaks testLocalLeaks;