@@ -12894,12 +12894,18 @@ class TestOther : public TestFixture {
1289412894 check (" void foo() {\n " // #11200
1289512895 " float f = 1.0;\n "
1289612896 " 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 "
1289712904 " if (f > -1.0) {}\n "
1289812905 " }\n " );
1289912906 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+ " " ,
1290312909 errout_str ());
1290412910
1290512911 check (" void foo() {\n " // #13506
@@ -12921,12 +12927,18 @@ class TestOther : public TestFixture {
1292112927 check (" void foo() {\n " // #11200
1292212928 " float pf = +1.0;\n "
1292312929 " 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 "
1292412937 " if (pf > -1.0) {}\n "
1292512938 " }\n " );
1292612939 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+ " " ,
1293012942 errout_str ());
1293112943
1293212944 check (" void foo() {\n " // #13506
@@ -12947,13 +12959,19 @@ class TestOther : public TestFixture {
1294712959
1294812960 check (" void foo() {\n " // #11200
1294912961 " float nf = -1.0;\n "
12950- " if (nf > 1.0) {}\n "
1295112962 " if (nf > -1.0) {}\n "
1295212963 " }\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 " );
1295312972 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+ " " ,
1295712975 errout_str ());
1295812976
1295912977 check (" void foo() {\n " // #13508
0 commit comments