]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | |
2 | // Copyright John Maddock 2007. | |
3 | ||
4 | // Use, modification and distribution are subject to the | |
5 | // Boost Software License, Version 1.0. | |
6 | // (See accompanying file LICENSE_1_0.txt | |
7 | // or copy at http://www.boost.org/LICENSE_1_0.txt) | |
8 | ||
9 | #include <boost/math/policies/policy.hpp> | |
7c673cae FG |
10 | #define BOOST_TEST_MAIN |
11 | #include <boost/test/unit_test.hpp> // for test_main | |
12 | #include <iostream> | |
1e59de90 | 13 | #include <type_traits> |
7c673cae FG |
14 | |
15 | template <class P1, class P2> | |
16 | bool check_same(const P1&, const P2&) | |
17 | { | |
1e59de90 | 18 | if(!std::is_same<P1, P2>::value) |
7c673cae FG |
19 | { |
20 | std::cout << "P1 = " << typeid(P1).name() << std::endl; | |
21 | std::cout << "P2 = " << typeid(P2).name() << std::endl; | |
22 | } | |
1e59de90 | 23 | return std::is_same<P1, P2>::value; |
7c673cae FG |
24 | } |
25 | ||
26 | ||
27 | BOOST_AUTO_TEST_CASE( test_main ) | |
28 | { | |
29 | using namespace boost::math::policies; | |
30 | using namespace boost; | |
31 | ||
1e59de90 TL |
32 | BOOST_CHECK((std::is_same<normalise<policy<digits2<20>, promote_float<false>, discrete_quantile<integer_round_down>, denorm_error<throw_on_error>, domain_error<ignore_error> > >::type::domain_error_type, domain_error<ignore_error> >::value)); |
33 | BOOST_CHECK((std::is_same<normalise<policy<digits2<20>, promote_float<false>, discrete_quantile<integer_round_down>, denorm_error<throw_on_error>, domain_error<ignore_error> > >::type::pole_error_type, pole_error<BOOST_MATH_POLE_ERROR_POLICY> >::value)); | |
34 | BOOST_CHECK((std::is_same<normalise<policy<digits2<20>, promote_float<false>, discrete_quantile<integer_round_down>, denorm_error<throw_on_error>, domain_error<ignore_error> > >::type::overflow_error_type, overflow_error<BOOST_MATH_OVERFLOW_ERROR_POLICY> >::value)); | |
35 | BOOST_CHECK((std::is_same<normalise<policy<digits2<20>, promote_float<false>, discrete_quantile<integer_round_down>, denorm_error<throw_on_error>, domain_error<ignore_error> > >::type::underflow_error_type, underflow_error<BOOST_MATH_UNDERFLOW_ERROR_POLICY> >::value)); | |
36 | BOOST_CHECK((std::is_same<normalise<policy<digits2<20>, promote_float<false>, discrete_quantile<integer_round_down>, denorm_error<throw_on_error>, domain_error<ignore_error> > >::type::denorm_error_type, denorm_error<throw_on_error> >::value)); | |
37 | BOOST_CHECK((std::is_same<normalise<policy<digits2<20>, promote_float<false>, discrete_quantile<integer_round_down>, denorm_error<throw_on_error>, domain_error<ignore_error> > >::type::evaluation_error_type, evaluation_error<BOOST_MATH_EVALUATION_ERROR_POLICY> >::value)); | |
38 | BOOST_CHECK((std::is_same<normalise<policy<digits2<20>, promote_float<false>, discrete_quantile<integer_round_down>, denorm_error<throw_on_error>, domain_error<ignore_error> > >::type::indeterminate_result_error_type, indeterminate_result_error<BOOST_MATH_INDETERMINATE_RESULT_ERROR_POLICY> >::value)); | |
39 | BOOST_CHECK((std::is_same<normalise<policy<digits2<20>, promote_float<false>, discrete_quantile<integer_round_down>, denorm_error<throw_on_error>, domain_error<ignore_error> > >::type::precision_type, digits2<20> >::value)); | |
40 | BOOST_CHECK((std::is_same<normalise<policy<digits2<20>, promote_float<false>, discrete_quantile<integer_round_down>, denorm_error<throw_on_error>, domain_error<ignore_error> > >::type::promote_float_type, promote_float<false> >::value)); | |
41 | BOOST_CHECK((std::is_same<normalise<policy<digits2<20>, promote_float<false>, discrete_quantile<integer_round_down>, denorm_error<throw_on_error>, domain_error<ignore_error> > >::type::promote_double_type, policy<>::promote_double_type>::value)); | |
42 | BOOST_CHECK((std::is_same<normalise<policy<digits2<20>, promote_float<false>, discrete_quantile<integer_round_down>, denorm_error<throw_on_error>, domain_error<ignore_error> > >::type::discrete_quantile_type, discrete_quantile<integer_round_down> >::value)); | |
7c673cae FG |
43 | |
44 | ||
45 | } // BOOST_AUTO_TEST_CASE( test_main ) | |
46 | ||
47 | ||
48 |