Skip to content

Commit 16ef2c1

Browse files
Add test for #6372 (#4090)
* Add tests for #6870, #10749 * Add test for #6372
1 parent 8c0561a commit 16ef2c1

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

test/testcondition.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5085,6 +5085,11 @@ class TestCondition : public TestFixture {
50855085
"}", &settingsUnix64);
50865086
ASSERT_EQUALS("[test.cpp:2]: (style) Comparing expression of type 'unsigned char' against value 256. Condition is always false.\n", errout.str());
50875087

5088+
check("void f(unsigned char* b, int i) {\n" // #6372
5089+
" if (b[i] == 256) {}\n"
5090+
"}", &settingsUnix64);
5091+
ASSERT_EQUALS("[test.cpp:2]: (style) Comparing expression of type 'unsigned char' against value 256. Condition is always false.\n", errout.str());
5092+
50885093
check("void f(unsigned char c) {\n"
50895094
" if (c == 255) {}\n"
50905095
"}", &settingsUnix64);

0 commit comments

Comments
 (0)