Skip to content

Commit

Permalink
Add test for #8192
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github committed Dec 13, 2023
1 parent ad35c54 commit e95caf6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/testcondition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5194,6 +5194,16 @@ class TestCondition : public TestFixture {
" for (int i = 0; i < N; a[i++] = false);\n"
"}\n");
ASSERT_EQUALS("", errout.str());

check("void f() {\n" // #8192
" for (int i = 0; i > 10; ++i) {}\n"
"}\n");
TODO_ASSERT_EQUALS("[test.cpp:2]: (style) Condition 'i>10' is always false\n", "", errout.str());

check("void f() {\n"
" for (int i = 1000; i < 20; ++i) {}\n"
"}\n");
ASSERT_EQUALS("[test.cpp:2]: (style) Condition 'i<20' is always false\n", errout.str());
}

void alwaysTrueTryCatch()
Expand Down

0 comments on commit e95caf6

Please sign in to comment.