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
+16-12Lines changed: 16 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -4465,9 +4465,12 @@ class TestCondition : public TestFixture {
4465
4465
" float f = 9.9f;\n"
4466
4466
" if(f < 10) {}\n"
4467
4467
"}\n");
4468
-
ASSERT_EQUALS("[test.cpp:3]: (style) Condition 'i>9.9' is always true\n"
4469
-
"[test.cpp:5]: (style) Condition 'f<10' is always true\n",
4470
-
errout_str());
4468
+
TODO_ASSERT_EQUALS(
4469
+
"[test.cpp:3]: (style) Condition 'i>9.9' is always true\n"
4470
+
"[test.cpp:5]: (style) Condition 'f<10' is always true\n",
4471
+
"[test.cpp:3]: (style) Condition 'i>9.9' is always false\n"
4472
+
"[test.cpp:5]: (style) Condition 'f<10' is always false\n",
4473
+
errout_str());
4471
4474
check("constexpr int f() {\n"// #11238
4472
4475
" return 1;\n"
4473
4476
"}\n"
@@ -5778,7 +5781,7 @@ class TestCondition : public TestFixture {
5778
5781
" if (f > 10.0) {}\n"
5779
5782
" if (f < 10.0) {}\n"
5780
5783
"}\n");
5781
-
TODO_ASSERT_EQUALS("", "[test.cpp:2] -> [test.cpp:3] -> [test.cpp:4]: (style) The if condition is the same as the previous if condition\n", errout_str());
5784
+
ASSERT_EQUALS("", errout_str());
5782
5785
}
5783
5786
5784
5787
voidcheckInvalidTestForOverflow() {
@@ -6244,13 +6247,13 @@ class TestCondition : public TestFixture {
6244
6247
" float f = 1.0;\n"
6245
6248
" if (f > 1.0f) {}\n"
6246
6249
"}\n");
6247
-
TODO_ASSERT_EQUALS("[test.cpp:3]: (style) Condition 'f>1.0f' is always false\n", "", errout_str());
6250
+
ASSERT_EQUALS("[test.cpp:3]: (style) Condition 'f>1.0f' is always false\n", errout_str());
6248
6251
6249
6252
check("void foo() {\n"// #11199
6250
6253
" float f = 1.0f;\n"
6251
6254
" if (f > 1.0) {}\n"
6252
6255
"}\n");
6253
-
TODO_ASSERT_EQUALS("[test.cpp:3]: (style) Condition 'f>1.0' is always false\n", "", errout_str());
6256
+
ASSERT_EQUALS("[test.cpp:3]: (style) Condition 'f>1.0' is always false\n", errout_str());
6254
6257
6255
6258
check("void foo() {\n"// #11201
6256
6259
" float f = 0x1.4p+3;\n"// hex fraction 1.4 (decimal 1.25) scaled by 2^3, that is 10.0
@@ -6260,26 +6263,27 @@ class TestCondition : public TestFixture {
6260
6263
TODO_ASSERT_EQUALS(
6261
6264
"[test.cpp:3]: (style) Condition 'f>9.9' is always true\n"
6262
6265
"[test.cpp:4]: (style) Condition 'f<9.9' is always false\n",
6263
-
"",
6266
+
"[test.cpp:3]: (style) Condition 'f>9.9' is always false\n"
6267
+
"[test.cpp:4]: (style) Condition 'f<9.9' is always false\n",
6264
6268
errout_str());
6265
6269
6266
6270
check("void foo() {\n"// #12330
6267
6271
" double d = 1.0;\n"
6268
6272
" if (d < 0.0) {}\n"
6269
6273
"}\n");
6270
-
TODO_ASSERT_EQUALS("[test.cpp:3]: (style) Condition 'd<0.0' is always false\n", "", errout_str());
6274
+
ASSERT_EQUALS("[test.cpp:3]: (style) Condition 'd<0.0' is always false\n", errout_str());
6271
6275
6272
6276
check("void foo() {\n"// #12330
6273
6277
" long double ld = 1.0;\n"
6274
6278
" if (ld < 0.0) {}\n"
6275
6279
"}\n");
6276
-
TODO_ASSERT_EQUALS("[test.cpp:3]: (style) Condition 'ld<0.0' is always false\n", "", errout_str());
6280
+
ASSERT_EQUALS("[test.cpp:3]: (style) Condition 'ld<0.0' is always false\n", errout_str());
6277
6281
6278
6282
check("void foo() {\n"// #12330
6279
6283
" float f = 1.0;\n"
6280
6284
" if (f < 0.0) {}\n"
6281
6285
"}\n");
6282
-
TODO_ASSERT_EQUALS("[test.cpp:3]: (style) Condition 'f<0.0' is always false\n", "", errout_str());
6286
+
ASSERT_EQUALS("[test.cpp:3]: (style) Condition 'f<0.0' is always false\n", errout_str());
6283
6287
6284
6288
check("void foo() {\n"// #12774
6285
6289
" float f = 1.0f;\n"
@@ -6291,7 +6295,7 @@ class TestCondition : public TestFixture {
6291
6295
"[test.cpp:3]: (style) Condition 'f>1.01f' is always false\n"
6292
6296
"[test.cpp:4]: (style) Condition 'f>1.00f' is always false\n"
6293
6297
"[test.cpp:5]: (style) Condition 'f>1' is always false\n",
6294
-
"[test.cpp:4]: (style) Condition 'f>1.00f' is always false\n"
6298
+
"[test.cpp:3]: (style) Condition 'f>1.01f' is always false\n"
6295
6299
"[test.cpp:5]: (style) Condition 'f>1' is always false\n",
6296
6300
errout_str());
6297
6301
@@ -6305,7 +6309,7 @@ class TestCondition : public TestFixture {
6305
6309
"[test.cpp:3]: (style) Condition 'f>1.01' is always false\n"
6306
6310
"[test.cpp:4]: (style) Condition 'f>1.00' is always false\n"
6307
6311
"[test.cpp:5]: (style) Condition 'f>1' is always false\n",
6308
-
"[test.cpp:4]: (style) Condition 'f>1.00' is always false\n"
6312
+
"[test.cpp:3]: (style) Condition 'f>1.01' is always false\n"
6309
6313
"[test.cpp:5]: (style) Condition 'f>1' is always false\n",
0 commit comments