added missing testcase for ticket #3370

This commit is contained in:
Ettl Martin 2012-06-04 21:21:14 +02:00
parent e146591b5d
commit 1245abe094
1 changed files with 12 additions and 0 deletions

View File

@ -63,6 +63,7 @@ private:
TEST_CASE(ifelse3); TEST_CASE(ifelse3);
TEST_CASE(ifelse4); TEST_CASE(ifelse4);
TEST_CASE(ifelse5); TEST_CASE(ifelse5);
TEST_CASE(ifelse6); // #3370
// switch // switch
TEST_CASE(switch1); TEST_CASE(switch1);
@ -327,6 +328,17 @@ private:
ASSERT_EQUALS("", errout.str()); ASSERT_EQUALS("", errout.str());
} }
void ifelse6() { // #3370
check("void f(int x) {\n"
" int *a = malloc(20);\n"
" if (x)\n"
" free(a);\n"
" else\n"
" a = 0;\n"
"}\n");
ASSERT_EQUALS("[test.c:7]: (information) free configuration is needed to establish if there is a leak or not\n", errout.str());
}
void switch1() { void switch1() {
check("void f() {\n" check("void f() {\n"
" char *p = 0;\n" " char *p = 0;\n"