Skip to content

Commit cd821f3

Browse files
Update testcondition.cpp [skip ci]
1 parent e364454 commit cd821f3

1 file changed

Lines changed: 6 additions & 10 deletions

File tree

test/testcondition.cpp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4065,7 +4065,7 @@ class TestCondition : public TestFixture {
40654065
" unsigned int num = max - 1;\n"
40664066
" if (num < 0) {}\n" // <- do not report knownConditionTrueFalse
40674067
"}");
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());
40694069

40704070
// #10297
40714071
check("void foo(size_t len, int start) {\n"
@@ -6324,28 +6324,24 @@ class TestCondition : public TestFixture {
63246324

63256325
check("void f(const unsigned char u) {\n"
63266326
" 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"
63296329
" if (u <= 0) {}\n"
63306330
" if (u > 255) {}\n" // warn
63316331
" if (u < 255) {}\n"
63326332
" if (u >= 255) {}\n"
63336333
" if (u <= 255) {}\n" // warn
63346334
" 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"
63376337
" if (0 >= u) {}\n"
63386338
" if (255 < u) {}\n" // warn
63396339
" if (255 > u) {}\n"
63406340
" if (255 <= u) {}\n"
63416341
" if (255 >= u) {}\n" // warn
63426342
"}\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"
63466344
"[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"
63496345
"[test.cpp:14:9]: (style) Comparing expression of type 'const unsigned char' against value 255. Condition is always false. [compareValueOutOfTypeRangeError]\n"
63506346
"[test.cpp:17:9]: (style) Comparing expression of type 'const unsigned char' against value 255. Condition is always true. [compareValueOutOfTypeRangeError]\n",
63516347
errout_str());

0 commit comments

Comments
 (0)