diff --git a/test/testother.cpp b/test/testother.cpp index 71c675cb8..751974c0c 100644 --- a/test/testother.cpp +++ b/test/testother.cpp @@ -4090,11 +4090,22 @@ private: "}\n"); ASSERT_EQUALS("[test.cpp:2] -> [test.cpp:3]: (style) Same expression on both sides of '&&' because '!b' and 'b1' represent the same value.\n", errout.str()); - // 7482 + // 7284 check("void f(void) {\n" " if (a || !!a) {}\n" "}\n"); ASSERT_EQUALS("[test.cpp:2]: (style) Same expression on both sides of '||' because 'a' and '!!a' represent the same value.\n", errout.str()); + + // 8205 + check("void f(int x) {\n" + " int Diag = 0;\n" + " switch (x) {\n" + " case 12:\n" + " if (Diag==0) {}\n" + " break;\n" + " }\n" + "}\n"); + ASSERT_EQUALS("[test.cpp:2] -> [test.cpp:5]: (style) The expression 'Diag == 0' is always true.\n", errout.str()); } void duplicateExpression8() {