Skip to content

Commit c3af708

Browse files
committed
Ticket #8209: Added regression test
1 parent 6a30eab commit c3af708

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

test/testcondition.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4024,6 +4024,13 @@ class TestCondition : public TestFixture {
40244024
"}\n");
40254025
ASSERT_EQUALS("[test.cpp:3]: (style) Condition 'i<=18' is always true\n", errout.str());
40264026

4027+
// #8209
4028+
check("void f() {\n"
4029+
" for(int x = 0; x < 3; ++x)\n"
4030+
" if(x == -5) {}\n"
4031+
"}");
4032+
ASSERT_EQUALS("[test.cpp:3]: (style) Condition 'x==-5' is always false\n", errout.str());
4033+
40274034
check("void f(unsigned int u1, unsigned int u2) {\n"
40284035
" if (u1 <= 10 && u2 >= 20) {\n"
40294036
" if (u1 != u2) {}\n"

0 commit comments

Comments
 (0)