From f866903e9d389da4fb6fe5bfaa2feaa5bbda645a Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Thu, 4 Jun 2015 13:17:29 +0100 Subject: [PATCH] Fix test failures for special functions. --- test/Jamfile.v2 | 14 +++++ test/math/instances/Jamfile.v2 | 1 + test/math/test_carlson_1.cpp | 63 +++++++++++++++++++ .../{test_carlson.cpp => test_carlson_2.cpp} | 1 + test/math/test_carlson_3.cpp | 62 ++++++++++++++++++ test/math/test_carlson_4.cpp | 62 ++++++++++++++++++ test/math/test_digamma.cpp | 7 +++ test/math/test_ellint_3.cpp | 7 +++ 8 files changed, 217 insertions(+) create mode 100644 test/math/test_carlson_1.cpp rename test/math/{test_carlson.cpp => test_carlson_2.cpp} (99%) create mode 100644 test/math/test_carlson_3.cpp create mode 100644 test/math/test_carlson_4.cpp diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 16093110..359ba2d1 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -698,7 +698,9 @@ if $(enable-specfun) TEST_MPFR_50 speed BOOST_ALL_NO_LIB + BOOST_OPTIONAL_USE_OLD_DEFINITION_OF_NONE msvc:-bigobj + ../../math/include_private release : $(source:B)_mpfr ; run $(source) gmp @@ -712,7 +714,9 @@ if $(enable-specfun) speed TEST_MPF_50 BOOST_ALL_NO_LIB + BOOST_OPTIONAL_USE_OLD_DEFINITION_OF_NONE msvc:-bigobj + ../../math/include_private release : $(source:B)_mpf ; run $(source) /boost/test//boost_unit_test_framework/static @@ -723,8 +727,10 @@ if $(enable-specfun) : # requirements TEST_CPP_DEC_FLOAT BOOST_ALL_NO_LIB + BOOST_OPTIONAL_USE_OLD_DEFINITION_OF_NONE speed msvc:-bigobj + ../../math/include_private release : $(source:B)_cpp_dec_float ; run $(source) /boost/test//boost_unit_test_framework/static @@ -735,8 +741,10 @@ if $(enable-specfun) : # requirements TEST_CPP_BIN_FLOAT BOOST_ALL_NO_LIB + BOOST_OPTIONAL_USE_OLD_DEFINITION_OF_NONE speed msvc:-bigobj + ../../math/include_private release : $(source:B)_cpp_bin_float ; run $(source) quadmath @@ -750,7 +758,9 @@ if $(enable-specfun) speed TEST_FLOAT128 BOOST_ALL_NO_LIB + BOOST_OPTIONAL_USE_OLD_DEFINITION_OF_NONE msvc:-bigobj + ../../math/include_private release : $(source:B)_float128 ; run $(source) @@ -764,7 +774,9 @@ if $(enable-specfun) speed TEST_FLOAT128 BOOST_ALL_NO_LIB + BOOST_OPTIONAL_USE_OLD_DEFINITION_OF_NONE msvc:-bigobj + ../../math/include_private release : $(source:B)_intel_quad ; } @@ -782,8 +794,10 @@ if $(enable-specfun) : # requirements speed BOOST_ALL_NO_LIB + BOOST_OPTIONAL_USE_OLD_DEFINITION_OF_NONE msvc:-bigobj [ check-target-builds ../config//has_mpfr : TEST_MPFR gmp mpfr : ] + ../../math/include_private release ; } } diff --git a/test/math/instances/Jamfile.v2 b/test/math/instances/Jamfile.v2 index 9e6aa472..a01af496 100644 --- a/test/math/instances/Jamfile.v2 +++ b/test/math/instances/Jamfile.v2 @@ -33,6 +33,7 @@ project : requirements gcc:-Wall gcc:-Wextra intel:SLOW_COMPILER + BOOST_OPTIONAL_USE_OLD_DEFINITION_OF_NONE ; lib gmp : : $(gmp_path) ; diff --git a/test/math/test_carlson_1.cpp b/test/math/test_carlson_1.cpp new file mode 100644 index 00000000..4309a5b9 --- /dev/null +++ b/test/math/test_carlson_1.cpp @@ -0,0 +1,63 @@ +/////////////////////////////////////////////////////////////// +// Copyright 2011 John Maddock. Distributed under the Boost +// Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_ + +#include "setup.hpp" +#include "table_type.hpp" +#define TEST_UDT +#define TEST1 + +#include +#include +#include "libs/math/test/test_carlson.hpp" + +void expected_results() +{ + // + // Define the max and mean errors expected for + // various compilers and platforms. + // + add_expected_result( + ".*", // compiler + ".*", // stdlib + ".*", // platform + ".*", // test type(s) + ".*RJ.*", // test data group + ".*", 2700, 250); // test function + add_expected_result( + ".*", // compiler + ".*", // stdlib + ".*", // platform + ".*", // test type(s) + ".*", // test data group + ".*", 40, 20); // test function + // + // Finish off by printing out the compiler/stdlib/platform names, + // we do this to make it easier to mark up expected error rates. + // + std::cout << "Tests run with " << BOOST_COMPILER << ", " + << BOOST_STDLIB << ", " << BOOST_PLATFORM << std::endl; +} + +template +void test(T t, const char* p) +{ + test_spots(t, p); +} + +BOOST_AUTO_TEST_CASE( test_main ) +{ + using namespace boost::multiprecision; + expected_results(); + // + // Test at: + // 18 decimal digits: tests 80-bit long double approximations + // 30 decimal digits: tests 128-bit long double approximations + // 35 decimal digits: tests arbitrary precision code + // + ALL_TESTS +} + + + diff --git a/test/math/test_carlson.cpp b/test/math/test_carlson_2.cpp similarity index 99% rename from test/math/test_carlson.cpp rename to test/math/test_carlson_2.cpp index 58cbee63..933108d9 100644 --- a/test/math/test_carlson.cpp +++ b/test/math/test_carlson_2.cpp @@ -6,6 +6,7 @@ #include "setup.hpp" #include "table_type.hpp" #define TEST_UDT +#define TEST2 #include #include "libs/math/test/test_carlson.hpp" diff --git a/test/math/test_carlson_3.cpp b/test/math/test_carlson_3.cpp new file mode 100644 index 00000000..a4b723a6 --- /dev/null +++ b/test/math/test_carlson_3.cpp @@ -0,0 +1,62 @@ +/////////////////////////////////////////////////////////////// +// Copyright 2011 John Maddock. Distributed under the Boost +// Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_ + +#include "setup.hpp" +#include "table_type.hpp" +#define TEST_UDT +#define TEST3 + +#include +#include "libs/math/test/test_carlson.hpp" + +void expected_results() +{ + // + // Define the max and mean errors expected for + // various compilers and platforms. + // + add_expected_result( + ".*", // compiler + ".*", // stdlib + ".*", // platform + ".*", // test type(s) + ".*RJ.*", // test data group + ".*", 2700, 250); // test function + add_expected_result( + ".*", // compiler + ".*", // stdlib + ".*", // platform + ".*", // test type(s) + ".*", // test data group + ".*", 40, 20); // test function + // + // Finish off by printing out the compiler/stdlib/platform names, + // we do this to make it easier to mark up expected error rates. + // + std::cout << "Tests run with " << BOOST_COMPILER << ", " + << BOOST_STDLIB << ", " << BOOST_PLATFORM << std::endl; +} + +template +void test(T t, const char* p) +{ + test_spots(t, p); +} + +BOOST_AUTO_TEST_CASE( test_main ) +{ + using namespace boost::multiprecision; + expected_results(); + // + // Test at: + // 18 decimal digits: tests 80-bit long double approximations + // 30 decimal digits: tests 128-bit long double approximations + // 35 decimal digits: tests arbitrary precision code + // + ALL_TESTS +} + + + diff --git a/test/math/test_carlson_4.cpp b/test/math/test_carlson_4.cpp new file mode 100644 index 00000000..abea8163 --- /dev/null +++ b/test/math/test_carlson_4.cpp @@ -0,0 +1,62 @@ +/////////////////////////////////////////////////////////////// +// Copyright 2011 John Maddock. Distributed under the Boost +// Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_ + +#include "setup.hpp" +#include "table_type.hpp" +#define TEST_UDT +#define TEST4 + +#include +#include "libs/math/test/test_carlson.hpp" + +void expected_results() +{ + // + // Define the max and mean errors expected for + // various compilers and platforms. + // + add_expected_result( + ".*", // compiler + ".*", // stdlib + ".*", // platform + ".*", // test type(s) + ".*RJ.*", // test data group + ".*", 2700, 250); // test function + add_expected_result( + ".*", // compiler + ".*", // stdlib + ".*", // platform + ".*", // test type(s) + ".*", // test data group + ".*", 40, 20); // test function + // + // Finish off by printing out the compiler/stdlib/platform names, + // we do this to make it easier to mark up expected error rates. + // + std::cout << "Tests run with " << BOOST_COMPILER << ", " + << BOOST_STDLIB << ", " << BOOST_PLATFORM << std::endl; +} + +template +void test(T t, const char* p) +{ + test_spots(t, p); +} + +BOOST_AUTO_TEST_CASE( test_main ) +{ + using namespace boost::multiprecision; + expected_results(); + // + // Test at: + // 18 decimal digits: tests 80-bit long double approximations + // 30 decimal digits: tests 128-bit long double approximations + // 35 decimal digits: tests arbitrary precision code + // + ALL_TESTS +} + + + diff --git a/test/math/test_digamma.cpp b/test/math/test_digamma.cpp index e3a1bd56..b6b3afe5 100644 --- a/test/math/test_digamma.cpp +++ b/test/math/test_digamma.cpp @@ -30,6 +30,13 @@ void expected_results() ".*", // test type(s) ".*Negative.*", // test data group ".*", 350, 40); // test function + add_expected_result( + ".*", // compiler + ".*", // stdlib + ".*", // platform + ".*cpp_dec_float.*", // test type(s) + ".*Near the Positive Root.*", // test data group + ".*", 2500, 200); // test function add_expected_result( ".*", // compiler ".*", // stdlib diff --git a/test/math/test_ellint_3.cpp b/test/math/test_ellint_3.cpp index 21e12bd5..e7ef10d4 100644 --- a/test/math/test_ellint_3.cpp +++ b/test/math/test_ellint_3.cpp @@ -37,6 +37,13 @@ void expected_results() ".*", // test type(s) ".*Large.*", // test data group ".*", 75, 40); // test function + add_expected_result( + ".*", // compiler + ".*", // stdlib + ".*", // platform + ".*cpp_bin_float_quad.*", // test type(s) + ".*Mathworld.*", // test data group + ".*", 500, 100); // test function #ifdef BOOST_INTEL add_expected_result( ".*", // compiler