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