#3344 added missing testcase
This commit is contained in:
parent
8494df74e6
commit
2848c61e88
|
@ -1163,6 +1163,15 @@ private:
|
||||||
" return a[0];\n"
|
" return a[0];\n"
|
||||||
"}");
|
"}");
|
||||||
ASSERT_EQUALS("", errout.str());
|
ASSERT_EQUALS("", errout.str());
|
||||||
|
|
||||||
|
// ticket #3344
|
||||||
|
checkUninitVar("void f(){\n"
|
||||||
|
" char *strMsg = \"This is a message\";\n"
|
||||||
|
" char *buffer=(char*)malloc(128*sizeof(char));\n"
|
||||||
|
" strcpy(strMsg,buffer);\n"
|
||||||
|
" free(buffer);\n"
|
||||||
|
"}\n");
|
||||||
|
ASSERT_EQUALS("[test.cpp:4]: (error) Data is allocated but not initialized: buffer\n", errout.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
// alloc..
|
// alloc..
|
||||||
|
|
Loading…
Reference in New Issue