• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //  Copyright John Maddock 2006-15.
2 //  Copyright Paul A. Bristow 2007
3 //  Use, modification and distribution are subject to the
4 //  Boost Software License, Version 1.0. (See accompanying file
5 //  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 
7 #define BOOST_MATH_OVERFLOW_ERROR_POLICY ignore_error
8 #include "bindings.hpp"
9 #include "../../test/log1p_expm1_test.hpp"
10 #include <boost/math/special_functions/expm1.hpp>
11 #include <boost/math/special_functions/log1p.hpp>
12 #define BOOST_TEST_MAIN
13 #include <boost/test/unit_test.hpp>
14 
15 BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES(test_main, 10000);
16 
BOOST_AUTO_TEST_CASE(test_main)17 BOOST_AUTO_TEST_CASE(test_main)
18 {
19    BOOST_MATH_CONTROL_FP;
20 
21    error_stream_replacer rep;
22 
23 #ifdef TYPE_TO_TEST
24 
25    test(static_cast<TYPE_TO_TEST>(0), NAME_OF_TYPE_TO_TEST);
26 
27 #else
28    bool test_float = false;
29    bool test_double = false;
30    bool test_long_double = false;
31 
32    if(std::numeric_limits<long double>::digits == std::numeric_limits<double>::digits)
33    {
34       //
35       // Don't bother with long double, it's the same as double:
36       //
37       if(BOOST_MATH_PROMOTE_FLOAT_POLICY == false)
38          test_float = true;
39       test_double = true;
40    }
41    else
42    {
43       if(BOOST_MATH_PROMOTE_FLOAT_POLICY == false)
44          test_float = true;
45       if(BOOST_MATH_PROMOTE_DOUBLE_POLICY == false)
46          test_double = true;
47       test_long_double = true;
48    }
49 
50 #ifdef ALWAYS_TEST_DOUBLE
51    test_double = true;
52 #endif
53 
54    if(test_float)
55       test(0.0f, "float");
56    if(test_double)
57       test(0.0, "double");
58    if(test_long_double)
59       test(0.0L, "long double");
60 #ifdef BOOST_MATH_USE_FLOAT128
61    //test(0.0Q, "__float128");
62 #endif
63 
64 
65 #endif
66 }
67 
68