Added test cases for #4801 (Cppcheck fails to parse Posix (crash in CheckOther::checkPipeParameterSize()))

This commit is contained in:
Alexander Mai 2013-07-29 10:57:41 +02:00 committed by Daniel Marjamäki
parent 545aad579f
commit 3e9f6daa00
1 changed files with 17 additions and 0 deletions

View File

@ -6097,6 +6097,23 @@ private:
"}\n"); "}\n");
ASSERT_EQUALS("", errout.str()); ASSERT_EQUALS("", errout.str());
// avoid crash with pointer variable - for local variable on stack as well - see #4801
check("void foo {\n"
" int *cp;\n"
" if ( pipe (cp) == -1 ) {\n"
" return;\n"
" }\n"
"}\n");
ASSERT_EQUALS("", errout.str());
// test with unknown variable
check("void foo {\n"
" if ( pipe (cp) == -1 ) {\n"
" return;\n"
" }\n"
"}\n");
ASSERT_EQUALS("", errout.str());
} }
void checkCastIntToCharAndBack() { // #160 void checkCastIntToCharAndBack() { // #160