diff --git a/lib/checkother.cpp b/lib/checkother.cpp index d516d0189..be64de639 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -1126,7 +1126,7 @@ void CheckOther::checkIncorrectLogicOperator() { 0, { First, "<=" }, "&&", { NA, "!=" }, 0, Less, SecondTrue }, // (x <= 1) && (x != 3) <- second expression always true { "!!&&", { First, ">|>=" }, "%oror%", { First, ">|>=" }, "!!&&", LessEqual, SecondTrue }, // (x > 4) || (x > 5) <- second expression always true { "!!&&", { First, "<|<=" }, "%oror%", { First, "<|<=" }, "!!&&", MoreEqual, SecondTrue }, // (x < 5) || (x < 4) <- second expression always true - { 0, { First, ">|>=" }, "&&", { First, ">|>=" }, 0, LessEqual, SecondTrue }, // (x > 4) && (x > 5) <- second expression always true + { 0, { First, ">|>=" }, "&&", { First, ">|>=" }, 0, MoreEqual, SecondTrue }, // (x > 4) && (x > 5) <- second expression always true { 0, { First, "<|<=" }, "&&", { First, "<|<=" }, 0, MoreEqual, SecondTrue }, // (x < 5) && (x < 4) <- second expression always true }; diff --git a/test/testother.cpp b/test/testother.cpp index 95d5848a8..e0462beb8 100644 --- a/test/testother.cpp +++ b/test/testother.cpp @@ -3001,7 +3001,7 @@ private: " b = x < 6 && x < 5;\n" " b = x < 5 || x < 6;\n" "}"); - ASSERT_EQUALS("[test.cpp:2]: (style) Redundant condition: If x > 5, the comparison x > 6 is always true.\n" + ASSERT_EQUALS("[test.cpp:2]: (style) Redundant condition: If x > 6, the comparison x > 5 is always true.\n" "[test.cpp:3]: (style) Redundant condition: If x > 5, the comparison x > 6 is always true.\n" "[test.cpp:4]: (style) Redundant condition: If x < 6, the comparison x < 5 is always true.\n" "[test.cpp:5]: (style) Redundant condition: If x < 6, the comparison x < 5 is always true.\n", errout.str());