Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r79576 - trunk/libs/math/test
From: john_at_[hidden]
Date: 2012-07-17 12:54:42


Author: johnmaddock
Date: 2012-07-17 12:54:41 EDT (Tue, 17 Jul 2012)
New Revision: 79576
URL: http://svn.boost.org/trac/boost/changeset/79576

Log:
Fix up Linux x64 tests a little better - note that the test with the FPU in FTZ mode still fail pretty badly, especially with Intel-12.1
Text files modified:
   trunk/libs/math/test/test_next.cpp | 12 +++++++-----
   1 files changed, 7 insertions(+), 5 deletions(-)

Modified: trunk/libs/math/test/test_next.cpp
==============================================================================
--- trunk/libs/math/test/test_next.cpp (original)
+++ trunk/libs/math/test/test_next.cpp 2012-07-17 12:54:41 EDT (Tue, 17 Jul 2012)
@@ -36,10 +36,10 @@
    BOOST_CHECK(float_next(val) > val);
    BOOST_CHECK_EQUAL(float_distance(float_prior(val), val), 1);
    BOOST_CHECK(float_prior(val) < val);
- BOOST_CHECK_EQUAL(float_distance(nextafter(val, upper), val), -1);
- BOOST_CHECK(nextafter(val, upper) > val);
- BOOST_CHECK_EQUAL(float_distance(nextafter(val, lower), val), 1);
- BOOST_CHECK(nextafter(val, lower) < val);
+ BOOST_CHECK_EQUAL(float_distance((boost::math::nextafter)(val, upper), val), -1);
+ BOOST_CHECK((boost::math::nextafter)(val, upper) > val);
+ BOOST_CHECK_EQUAL(float_distance((boost::math::nextafter)(val, lower), val), 1);
+ BOOST_CHECK((boost::math::nextafter)(val, lower) < val);
    BOOST_CHECK_EQUAL(float_distance(float_next(float_next(val)), val), -2);
    BOOST_CHECK_EQUAL(float_distance(float_prior(float_prior(val)), val), 2);
    BOOST_CHECK_EQUAL(float_distance(float_prior(float_prior(val)), float_next(float_next(val))), 4);
@@ -157,13 +157,15 @@
    test_values(boost::math::concepts::real_concept(0), "real_concept");
 #endif
 #if defined(TEST_SSE2)
+#ifdef _WIN32
+ // These tests fail pretty badly on Linux x64, especially with Intel-12.1
    _MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON);
    std::cout << "Testing again with Flush-To-Zero set" << std::endl;
    std::cout << "SSE2 control word is: " << std::hex << _mm_getcsr() << std::endl;
    test_values(1.0f, "float");
    test_values(1.0, "double");
    _MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_OFF);
-
+#endif
    BOOST_ASSERT((_mm_getcsr() & 0x40) == 0);
    _mm_setcsr(_mm_getcsr() | 0x40);
    std::cout << "Testing again with Denormals-Are-Zero set" << std::endl;


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk