You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/testcondition.cpp
+6-10Lines changed: 6 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -4065,7 +4065,7 @@ class TestCondition : public TestFixture {
4065
4065
" unsigned int num = max - 1;\n"
4066
4066
" if (num < 0) {}\n"// <- do not report knownConditionTrueFalse
4067
4067
"}");
4068
-
ASSERT_EQUALS("[test.cpp:3:15]: (style) Comparing expression of type 'unsigned int' against value 0. Condition is always false. [compareValueOutOfTypeRangeError]\n", errout_str());
4068
+
ASSERT_EQUALS("", errout_str());
4069
4069
4070
4070
// #10297
4071
4071
check("void foo(size_t len, int start) {\n"
@@ -6324,28 +6324,24 @@ class TestCondition : public TestFixture {
6324
6324
6325
6325
check("void f(const unsigned char u) {\n"
6326
6326
" if (u > 0) {}\n"
6327
-
" if (u < 0) {}\n"// warn
6328
-
" if (u >= 0) {}\n"// warn
6327
+
" if (u < 0) {}\n"
6328
+
" if (u >= 0) {}\n"
6329
6329
" if (u <= 0) {}\n"
6330
6330
" if (u > 255) {}\n"// warn
6331
6331
" if (u < 255) {}\n"
6332
6332
" if (u >= 255) {}\n"
6333
6333
" if (u <= 255) {}\n"// warn
6334
6334
" if (0 < u) {}\n"
6335
-
" if (0 > u) {}\n"// warn
6336
-
" if (0 <= u) {}\n"// warn
6335
+
" if (0 > u) {}\n"
6336
+
" if (0 <= u) {}\n"
6337
6337
" if (0 >= u) {}\n"
6338
6338
" if (255 < u) {}\n"// warn
6339
6339
" if (255 > u) {}\n"
6340
6340
" if (255 <= u) {}\n"
6341
6341
" if (255 >= u) {}\n"// warn
6342
6342
"}\n", settingsUnix64);
6343
-
ASSERT_EQUALS("[test.cpp:3:14]: (style) Comparing expression of type 'const unsigned char' against value 0. Condition is always false. [compareValueOutOfTypeRangeError]\n"
6344
-
"[test.cpp:4:14]: (style) Comparing expression of type 'const unsigned char' against value 0. Condition is always true. [compareValueOutOfTypeRangeError]\n"
6345
-
"[test.cpp:6:14]: (style) Comparing expression of type 'const unsigned char' against value 255. Condition is always false. [compareValueOutOfTypeRangeError]\n"
6343
+
ASSERT_EQUALS("[test.cpp:6:14]: (style) Comparing expression of type 'const unsigned char' against value 255. Condition is always false. [compareValueOutOfTypeRangeError]\n"
6346
6344
"[test.cpp:9:14]: (style) Comparing expression of type 'const unsigned char' against value 255. Condition is always true. [compareValueOutOfTypeRangeError]\n"
6347
-
"[test.cpp:11:9]: (style) Comparing expression of type 'const unsigned char' against value 0. Condition is always false. [compareValueOutOfTypeRangeError]\n"
6348
-
"[test.cpp:12:9]: (style) Comparing expression of type 'const unsigned char' against value 0. Condition is always true. [compareValueOutOfTypeRangeError]\n"
6349
6345
"[test.cpp:14:9]: (style) Comparing expression of type 'const unsigned char' against value 255. Condition is always false. [compareValueOutOfTypeRangeError]\n"
6350
6346
"[test.cpp:17:9]: (style) Comparing expression of type 'const unsigned char' against value 255. Condition is always true. [compareValueOutOfTypeRangeError]\n",
0 commit comments