#8206 - Added a regression test
This commit is contained in:
parent
260eb4acac
commit
b5719418ea
|
@ -3087,6 +3087,14 @@ private:
|
||||||
"}");
|
"}");
|
||||||
ASSERT_EQUALS("", errout.str());
|
ASSERT_EQUALS("", errout.str());
|
||||||
|
|
||||||
|
// #8206 - knownCondition always false
|
||||||
|
check("void f(int i)\n"
|
||||||
|
"{\n"
|
||||||
|
" if(i > 4)\n"
|
||||||
|
" for( int x = 0; i < 3; ++x){}\n" // <<
|
||||||
|
"}");
|
||||||
|
ASSERT_EQUALS("[test.cpp:3] -> [test.cpp:4]: (style) Condition 'i<3' is always false\n", errout.str());
|
||||||
|
|
||||||
// Skip literals
|
// Skip literals
|
||||||
check("void f() { if(true) {} }");
|
check("void f() { if(true) {} }");
|
||||||
ASSERT_EQUALS("", errout.str());
|
ASSERT_EQUALS("", errout.str());
|
||||||
|
|
Loading…
Reference in New Issue