added missing testcase for ticket #3370
This commit is contained in:
parent
e146591b5d
commit
1245abe094
|
@ -63,6 +63,7 @@ private:
|
|||
TEST_CASE(ifelse3);
|
||||
TEST_CASE(ifelse4);
|
||||
TEST_CASE(ifelse5);
|
||||
TEST_CASE(ifelse6); // #3370
|
||||
|
||||
// switch
|
||||
TEST_CASE(switch1);
|
||||
|
@ -327,6 +328,17 @@ private:
|
|||
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() {
|
||||
check("void f() {\n"
|
||||
" char *p = 0;\n"
|
||||
|
|
Loading…
Reference in New Issue