From 16ef2c1838988d1b32ab813c2826fc71b71ea53d Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Mon, 9 May 2022 20:26:15 +0200 Subject: [PATCH] Add test for #6372 (#4090) * Add tests for #6870, #10749 * Add test for #6372 --- test/testcondition.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/testcondition.cpp b/test/testcondition.cpp index b6cb6dcde..7107e99f7 100644 --- a/test/testcondition.cpp +++ b/test/testcondition.cpp @@ -5085,6 +5085,11 @@ private: "}", &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* 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" " if (c == 255) {}\n" "}", &settingsUnix64);