Boost logo

Boost-Commit :

From: john_at_[hidden]
Date: 2008-05-22 07:23:57


Author: johnmaddock
Date: 2008-05-22 07:23:57 EDT (Thu, 22 May 2008)
New Revision: 45645
URL: http://svn.boost.org/trac/boost/changeset/45645

Log:
Split test_tr1 into two: one for long double, and one for float and double types.
Text files modified:
   trunk/libs/math/build/Jamfile.v2 | 4 ++++
   trunk/libs/math/test/Jamfile.v2 | 9 ++++++++-
   trunk/libs/math/test/test_tr1.cpp | 25 +++++++++++++++++--------
   3 files changed, 29 insertions(+), 9 deletions(-)

Modified: trunk/libs/math/build/Jamfile.v2
==============================================================================
--- trunk/libs/math/build/Jamfile.v2 (original)
+++ trunk/libs/math/build/Jamfile.v2 2008-05-22 07:23:57 EDT (Thu, 22 May 2008)
@@ -49,6 +49,8 @@
 sph_neumann
 ;
 
+compile has_long_double_support.cpp ;
+
 lib boost_math_tr1 : ../src/tr1/$(TR1_SOURCES).cpp
     :
               <link>shared:<define>BOOST_MATH_TR1_DYN_LINK=1
@@ -62,6 +64,7 @@
 lib boost_math_tr1l : ../src/tr1/$(TR1_SOURCES)l.cpp
     :
               <link>shared:<define>BOOST_MATH_TR1_DYN_LINK=1
+ <dependency>has_long_double_support
    ;
 
 lib boost_math_c99 : ../src/tr1/$(C99_SOURCES).cpp
@@ -77,5 +80,6 @@
 lib boost_math_c99l : ../src/tr1/$(C99_SOURCES)l.cpp
     :
               <link>shared:<define>BOOST_MATH_TR1_DYN_LINK=1
+ <dependency>has_long_double_support
    ;
 

Modified: trunk/libs/math/test/Jamfile.v2
==============================================================================
--- trunk/libs/math/test/Jamfile.v2 (original)
+++ trunk/libs/math/test/Jamfile.v2 2008-05-22 07:23:57 EDT (Thu, 22 May 2008)
@@ -389,10 +389,17 @@
 run test_tr1.cpp
    ../build//boost_math_tr1
    ../build//boost_math_tr1f
- ../build//boost_math_tr1l
    ../build//boost_math_c99
    ../build//boost_math_c99f
+ ;
+
+run test_tr1.cpp
+ ../build//boost_math_tr1l
    ../build//boost_math_c99l
+ : : :
+ <define>TEST_LD=1
+ :
+ test_tr1_long_double
    ;
 
 compile compile_test/compl_abs_incl_test.cpp ;

Modified: trunk/libs/math/test/test_tr1.cpp
==============================================================================
--- trunk/libs/math/test/test_tr1.cpp (original)
+++ trunk/libs/math/test/test_tr1.cpp 2008-05-22 07:23:57 EDT (Thu, 22 May 2008)
@@ -18,6 +18,7 @@
 void test_values(float, const char* name)
 {
    std::cout << "Testing type " << name << std::endl;
+#ifndef TEST_LD
    //
    // First the C99 math functions:
    //
@@ -645,12 +646,14 @@
 
    BOOST_CHECK_CLOSE_FRACTION(tr1::sph_legendre(3, 2, static_cast<float>(0.5)), static_cast<float>(0.2061460599687871330692286791802688341213L), eps * 5000);
    BOOST_CHECK_CLOSE_FRACTION(tr1::sph_legendre(40, 15, static_cast<float>(0.75)), static_cast<float>(-0.406036847302819452666908966769096223205057182668333862900509L), eps * 5000);
+#endif
 }
 
 void test_values(double, const char* name)
 {
    std::cout << "Testing type " << name << std::endl;
 
+#ifndef TEST_LD
    double eps = boost::math::tools::epsilon<double>();
    BOOST_CHECK_CLOSE(tr1::acosh(std::cosh(0.5)), 0.5, 500 * eps);
    BOOST_CHECK_CLOSE(tr1::asinh(std::sinh(0.5)), 0.5, 500 * eps);
@@ -963,10 +966,12 @@
 
    BOOST_CHECK_CLOSE_FRACTION(tr1::sph_legendre(3, 2, static_cast<double>(0.5)), static_cast<double>(0.2061460599687871330692286791802688341213L), eps * 5000);
    BOOST_CHECK_CLOSE_FRACTION(tr1::sph_legendre(40, 15, static_cast<double>(0.75)), static_cast<double>(-0.406036847302819452666908966769096223205057182668333862900509L), eps * 5000);
+#endif
 }
 
 void test_values(long double, const char* name)
 {
+#ifdef TEST_LD
 #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
    std::cout << "Testing type " << name << std::endl;
 
@@ -1028,14 +1033,14 @@
    BOOST_CHECK(tr1::roundl(2.5L) == 3.0L);
    BOOST_CHECK(tr1::roundl(2.25L) == 2.0L);
 
- BOOST_CHECK(tr1::nextafterf(1.0L, 2.0L) > 1.0L);
- BOOST_CHECK(tr1::nextafterf(1.0L, -2.0L) < 1.0L);
- BOOST_CHECK(tr1::nextafterf(tr1::nextafterf(1.0L, 2.0L), -2.0L) == 1.0L);
- BOOST_CHECK(tr1::nextafterf(tr1::nextafterf(1.0L, -2.0L), 2.0L) == 1.0L);
- BOOST_CHECK(tr1::nextafterf(1.0L, 2.0L) > 1.0L);
- BOOST_CHECK(tr1::nextafterf(1.0L, -2.0L) < 1.0L);
- BOOST_CHECK(tr1::nextafterf(tr1::nextafterf(1.0L, 2.0L), -2.0L) == 1.0L);
- BOOST_CHECK(tr1::nextafterf(tr1::nextafterf(1.0L, -2.0L), 2.0L) == 1.0L);
+ BOOST_CHECK(tr1::nextafterl(1.0L, 2.0L) > 1.0L);
+ BOOST_CHECK(tr1::nextafterl(1.0L, -2.0L) < 1.0L);
+ BOOST_CHECK(tr1::nextafterl(tr1::nextafterl(1.0L, 2.0L), -2.0L) == 1.0L);
+ BOOST_CHECK(tr1::nextafterl(tr1::nextafterl(1.0L, -2.0L), 2.0L) == 1.0L);
+ BOOST_CHECK(tr1::nextafterl(1.0L, 2.0L) > 1.0L);
+ BOOST_CHECK(tr1::nextafterl(1.0L, -2.0L) < 1.0L);
+ BOOST_CHECK(tr1::nextafterl(tr1::nextafterl(1.0L, 2.0L), -2.0L) == 1.0L);
+ BOOST_CHECK(tr1::nextafterl(tr1::nextafterl(1.0L, -2.0L), 2.0L) == 1.0L);
 
    BOOST_CHECK(tr1::truncl(2.5L) == 2.0L);
    BOOST_CHECK(tr1::truncl(2.25L) == 2.0L);
@@ -1595,15 +1600,19 @@
    BOOST_CHECK_CLOSE_FRACTION(tr1::sph_legendre(3L, 2L, static_cast<long double>(0.5L)), static_cast<long double>(0.2061460599687871330692286791802688341213L), eps * 5000L);
    BOOST_CHECK_CLOSE_FRACTION(tr1::sph_legendre(40L, 15L, static_cast<long double>(0.75L)), static_cast<long double>(-0.406036847302819452666908966769096223205057182668333862900509L), eps * 5000L);
 #endif
+#endif
 }
 
 int test_main(int, char* [])
 {
+#ifndef TEST_LD
    test_values(1.0f, "float");
    test_values(1.0, "double");
+#else
 #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
    test_values(1.0L, "long double");
 #endif
+#endif
    return 0;
 }
 


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