@@ -12894,12 +12894,18 @@ class TestOther : public TestFixture {
12894
12894
check("void foo() {\n" // #11200
12895
12895
" float f = 1.0;\n"
12896
12896
" if (f > 1.0) {}\n"
12897
+ "}\n");
12898
+ ASSERT_EQUALS(
12899
+ "[test.cpp:2] -> [test.cpp:3]: (style) The comparison 'f > 1.0' is always false.\n",
12900
+ errout_str());
12901
+
12902
+ check("void foo() {\n" // #13508
12903
+ " float f = 1.0;\n"
12897
12904
" if (f > -1.0) {}\n"
12898
12905
"}\n");
12899
12906
TODO_ASSERT_EQUALS(
12900
- "[test.cpp:2] -> [test.cpp:3]: (style) The comparison 'f > 1.0' is always false.\n"
12901
- "[test.cpp:2] -> [test.cpp:4]: (style) The comparison 'f > -1.0' is always false.\n",
12902
- "[test.cpp:2] -> [test.cpp:3]: (style) The comparison 'f > 1.0' is always false.\n",
12907
+ "[test.cpp:2] -> [test.cpp:3]: (style) The comparison 'f > -1.0' is always false.\n",
12908
+ "",
12903
12909
errout_str());
12904
12910
12905
12911
check("void foo() {\n" // #13506
@@ -12921,12 +12927,18 @@ class TestOther : public TestFixture {
12921
12927
check("void foo() {\n" // #11200
12922
12928
" float pf = +1.0;\n"
12923
12929
" if (pf > 1.0) {}\n"
12930
+ "}\n");
12931
+ ASSERT_EQUALS(
12932
+ "[test.cpp:2] -> [test.cpp:3]: (style) The comparison 'pf > 1.0' is always false.\n",
12933
+ errout_str());
12934
+
12935
+ check("void foo() {\n" // #13508
12936
+ " float pf = +1.0;\n"
12924
12937
" if (pf > -1.0) {}\n"
12925
12938
"}\n");
12926
12939
TODO_ASSERT_EQUALS(
12927
- "[test.cpp:2] -> [test.cpp:3]: (style) The comparison 'pf > 1.0' is always false.\n"
12928
- "[test.cpp:2] -> [test.cpp:4]: (style) The comparison 'pf > -1.0' is always false.\n",
12929
- "[test.cpp:2] -> [test.cpp:3]: (style) The comparison 'pf > 1.0' is always false.\n",
12940
+ "[test.cpp:2] -> [test.cpp:3]: (style) The comparison 'pf > -1.0' is always false.\n",
12941
+ "",
12930
12942
errout_str());
12931
12943
12932
12944
check("void foo() {\n" // #13506
@@ -12947,13 +12959,19 @@ class TestOther : public TestFixture {
12947
12959
12948
12960
check("void foo() {\n" // #11200
12949
12961
" float nf = -1.0;\n"
12950
- " if (nf > 1.0) {}\n"
12951
12962
" if (nf > -1.0) {}\n"
12952
12963
"}\n");
12964
+ ASSERT_EQUALS(
12965
+ "[test.cpp:2] -> [test.cpp:3]: (style) The comparison 'nf > -1.0' is always false.\n",
12966
+ errout_str());
12967
+
12968
+ check("void foo() {\n" // #13508
12969
+ " float nf = -1.0;\n"
12970
+ " if (nf > 1.0) {}\n"
12971
+ "}\n");
12953
12972
TODO_ASSERT_EQUALS(
12954
- "[test.cpp:2] -> [test.cpp:3]: (style) The comparison 'nf > 1.0' is always false.\n"
12955
- "[test.cpp:2] -> [test.cpp:4]: (style) The comparison 'nf > -1.0' is always false.\n",
12956
- "[test.cpp:2] -> [test.cpp:4]: (style) The comparison 'nf > -1.0' is always false.\n",
12973
+ "[test.cpp:2] -> [test.cpp:3]: (style) The comparison 'nf > 1.0' is always false.\n",
12974
+ "",
12957
12975
errout_str());
12958
12976
12959
12977
check("void foo() {\n" // #13508
0 commit comments