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
+8-3Lines changed: 8 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -4586,7 +4586,7 @@ class TestCondition : public TestFixture {
4586
4586
check("void f(unsigned char c) {\n"
4587
4587
" if (c == 256) {}\n"
4588
4588
"}", &settingsUnix64);
4589
-
ASSERT_EQUALS("[test.cpp:2]: (style) Comparing expression of type 'unsigned char' against value 256. Condition is always true/false.\n", errout.str());
4589
+
ASSERT_EQUALS("[test.cpp:2]: (style) Comparing expression of type 'unsigned char' against value 256. Condition is always false.\n", errout.str());
4590
4590
4591
4591
check("void f(unsigned char c) {\n"
4592
4592
" if (c == 255) {}\n"
@@ -4602,12 +4602,12 @@ class TestCondition : public TestFixture {
4602
4602
check("void f(signed char x) {\n"
4603
4603
" if (x == 0xff) {}\n"
4604
4604
"}", &settingsUnix64);
4605
-
ASSERT_EQUALS("[test.cpp:2]: (style) Comparing expression of type 'signed char' against value 255. Condition is always true/false.\n", errout.str());
4605
+
ASSERT_EQUALS("[test.cpp:2]: (style) Comparing expression of type 'signed char' against value 255. Condition is always false.\n", errout.str());
4606
4606
4607
4607
check("void f(short x) {\n"
4608
4608
" if (x == 0xffff) {}\n"
4609
4609
"}", &settingsUnix64);
4610
-
ASSERT_EQUALS("[test.cpp:2]: (style) Comparing expression of type 'signed short' against value 65535. Condition is always true/false.\n", errout.str());
4610
+
ASSERT_EQUALS("[test.cpp:2]: (style) Comparing expression of type 'signed short' against value 65535. Condition is always false.\n", errout.str());
4611
4611
4612
4612
check("void f(int x) {\n"
4613
4613
" if (x == 0xffffffff) {}\n"
@@ -4629,6 +4629,11 @@ class TestCondition : public TestFixture {
4629
4629
" if ((c = foo()) != -1) {}\n"
4630
4630
"}", &settingsUnix64);
4631
4631
ASSERT_EQUALS("", errout.str());
4632
+
4633
+
check("void f(int x) {\n"
4634
+
" if (x < 3000000000) {}\n"
4635
+
"}", &settingsUnix64);
4636
+
ASSERT_EQUALS("[test.cpp:2]: (style) Comparing expression of type 'signed int' against value 3000000000. Condition is always true.\n", errout.str());
0 commit comments