Ticket #8209: Added regression test
This commit is contained in:
parent
6a30eabf21
commit
c3af708a55
|
@ -4024,6 +4024,13 @@ private:
|
||||||
"}\n");
|
"}\n");
|
||||||
ASSERT_EQUALS("[test.cpp:3]: (style) Condition 'i<=18' is always true\n", errout.str());
|
ASSERT_EQUALS("[test.cpp:3]: (style) Condition 'i<=18' is always true\n", errout.str());
|
||||||
|
|
||||||
|
// #8209
|
||||||
|
check("void f() {\n"
|
||||||
|
" for(int x = 0; x < 3; ++x)\n"
|
||||||
|
" if(x == -5) {}\n"
|
||||||
|
"}");
|
||||||
|
ASSERT_EQUALS("[test.cpp:3]: (style) Condition 'x==-5' is always false\n", errout.str());
|
||||||
|
|
||||||
check("void f(unsigned int u1, unsigned int u2) {\n"
|
check("void f(unsigned int u1, unsigned int u2) {\n"
|
||||||
" if (u1 <= 10 && u2 >= 20) {\n"
|
" if (u1 <= 10 && u2 >= 20) {\n"
|
||||||
" if (u1 != u2) {}\n"
|
" if (u1 != u2) {}\n"
|
||||||
|
|
Loading…
Reference in New Issue