Add test for #6372 (#4090)

* Add tests for #6870, #10749

* Add test for #6372
This commit is contained in:
chrchr-github 2022-05-09 20:26:15 +02:00 committed by GitHub
parent 8c0561a78b
commit 16ef2c1838
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -5085,6 +5085,11 @@ private:
"}", &settingsUnix64); "}", &settingsUnix64);
ASSERT_EQUALS("[test.cpp:2]: (style) Comparing expression of type 'unsigned char' against value 256. Condition is always false.\n", errout.str()); ASSERT_EQUALS("[test.cpp:2]: (style) Comparing expression of type 'unsigned char' against value 256. Condition is always false.\n", errout.str());
check("void f(unsigned char* b, int i) {\n" // #6372
" if (b[i] == 256) {}\n"
"}", &settingsUnix64);
ASSERT_EQUALS("[test.cpp:2]: (style) Comparing expression of type 'unsigned char' against value 256. Condition is always false.\n", errout.str());
check("void f(unsigned char c) {\n" check("void f(unsigned char c) {\n"
" if (c == 255) {}\n" " if (c == 255) {}\n"
"}", &settingsUnix64); "}", &settingsUnix64);