• 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_TEST_MAIN
8 #include "bindings.hpp"
9 #include "../../test/powm1_sqrtp1m1_test.hpp"
10 #include <boost/math/special_functions/powm1.hpp>
11 #include <boost/math/special_functions/sqrt1pm1.hpp>
12 #include <boost/test/unit_test.hpp>
13 
14 BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES(test_main, 10000);
15 
BOOST_AUTO_TEST_CASE(test_main)16 BOOST_AUTO_TEST_CASE(test_main)
17 {
18    BOOST_MATH_CONTROL_FP;
19 
20    error_stream_replacer rep;
21 
22 #ifdef TYPE_TO_TEST
23 
24    test_powm1_sqrtp1m1(static_cast<TYPE_TO_TEST>(0), NAME_OF_TYPE_TO_TEST);
25 
26 #else
27    bool test_float = false;
28    bool test_double = false;
29    bool test_long_double = false;
30 
31    if(std::numeric_limits<long double>::digits == std::numeric_limits<double>::digits)
32    {
33       //
34       // Don't bother with long double, it's the same as double:
35       //
36       if(BOOST_MATH_PROMOTE_FLOAT_POLICY == false)
37          test_float = true;
38       test_double = true;
39    }
40    else
41    {
42       if(BOOST_MATH_PROMOTE_FLOAT_POLICY == false)
43          test_float = true;
44       if(BOOST_MATH_PROMOTE_DOUBLE_POLICY == false)
45          test_double = true;
46       test_long_double = true;
47    }
48 
49 #ifdef ALWAYS_TEST_DOUBLE
50    test_double = true;
51 #endif
52 
53    if(test_float)
54       test_powm1_sqrtp1m1(0.0f, "float");
55    if(test_double)
56       test_powm1_sqrtp1m1(0.0, "double");
57    if(test_long_double)
58       test_powm1_sqrtp1m1(0.0L, "long double");
59 #ifdef BOOST_MATH_USE_FLOAT128
60    //test_powm1_sqrtp1m1(0.0Q, "__float128");
61 #endif
62 
63 
64 #endif
65 }
66 
67