#6313: Added test case for oppositeInnerCondition.
This commit is contained in:
parent
d45aa6170b
commit
1d910bc3bc
|
@ -1292,6 +1292,16 @@ private:
|
|||
"}");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
// #6313 - false postive: opposite conditions in nested if blocks when condition changed
|
||||
check("void Foo::Bar() {\n"
|
||||
" if(var){\n"
|
||||
" --var;\n"
|
||||
" if(!var){}\n"
|
||||
" else {}\n"
|
||||
" }\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
// #5874 - array
|
||||
check("void testOppositeConditions2() {\n"
|
||||
" int array[2] = { 0, 0 };\n"
|
||||
|
|
Loading…
Reference in New Issue