lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master c449cae 2/4: Enable a test that fails for now


From: Greg Chicares
Subject: [lmi-commits] [lmi] master c449cae 2/4: Enable a test that fails for now; dismiss an old gcc defect (VZ)
Date: Sun, 8 Jan 2017 18:02:24 +0000 (UTC)

branch: master
commit c449cae91966d8c0390a1fb8840974955b94a938
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Enable a test that fails for now; dismiss an old gcc defect (VZ)
    
    A fix for the failing test has been proposed, but requires further
    discussion.
    
    Tests for char*, similar to these char[] tests, have also been added.
    
    The gcc-4.1.2 defect was described here:
    
    http://lists.nongnu.org/archive/html/lmi/2008-06/msg00010.html
    
    value_cast.hpp:248: error: invalid operands of types 'const char (&)[2]'
             and 'int' to binary 'operator!='
    
    "in spite of the fact that there is no operator!=() anywhere"
    
    The diagnostic seems so absurd that it must have been a compiler defect.
    Conditionalizing the test on that gcc version has become pointless
    because we're now requiring gcc-4.9.1 for production.
---
 value_cast_test.cpp |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/value_cast_test.cpp b/value_cast_test.cpp
index 0612418..883bb13 100644
--- a/value_cast_test.cpp
+++ b/value_cast_test.cpp
@@ -736,15 +736,16 @@ int boost_tests()
     BOOST_TEST_EQUAL(true, value_cast<bool>(true));
     BOOST_TEST_EQUAL(false, value_cast<bool>(false));
 
-    // COMPILER !! Suppress this test for gcc-4.1.2, which refuses,
-    // defectively it would seem, to compile it. See:
-    //   http://lists.nongnu.org/archive/html/lmi/2008-06/msg00010.html
-#if !(defined __GNUC__ && 40102 == LMI_GCC_VERSION)
     BOOST_TEST_EQUAL(true, value_cast<bool>("1"));
-#endif // !(defined __GNUC__ && 40102 == LMI_GCC_VERSION)
+    BOOST_TEST_EQUAL(false, value_cast<bool>("0"));
+
+    // GWC addition: likewise, for char* rather than char[].
+    char const* p1 = "1";
+    BOOST_TEST_EQUAL(true, value_cast<bool>(p1));
+    char const* p0 = "0";
+    BOOST_TEST_EQUAL(false, value_cast<bool>(p0));
 
     // This fails; should it?
-//    BOOST_TEST_EQUAL(false, value_cast<bool>("0"));
 //    BOOST_TEST_THROW(value_cast<bool>(""), boost::bad_value_cast);
 //    BOOST_TEST_THROW(value_cast<bool>("Test"), boost::bad_value_cast);
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]