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
+14-9Lines changed: 14 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -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",
6351
6347
errout_str());
@@ -6355,6 +6351,15 @@ class TestCondition : public TestFixture {
6355
6351
"}\n", settingsUnix64);
6356
6352
ASSERT_EQUALS("[test.cpp:2:14]: (style) Comparing expression of type 'bool' against value 2. Condition is always true. [compareValueOutOfTypeRangeError]\n",
ASSERT_EQUALS("[test.cpp:3:14]: (style) Comparing expression of type 'const unsigned int &' against value 4294967295. Condition is always true. [compareValueOutOfTypeRangeError]\n"
6361
+
"[test.cpp:4:13]: (style) Comparing expression of type 'const unsigned int &' against value 4294967295. Condition is always false. [compareValueOutOfTypeRangeError]\n",
0 commit comments