2 // Copyright John Maddock 2007.
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)
9 #include <boost/math/policies/policy.hpp>
10 #define BOOST_TEST_MAIN
11 #include <boost/test/unit_test.hpp> // for test_main
13 #include <type_traits>
15 template <class P1
, class P2
>
16 bool check_same(const P1
&, const P2
&)
18 if(!std::is_same
<P1
, P2
>::value
)
20 std::cout
<< "P1 = " << typeid(P1
).name() << std::endl
;
21 std::cout
<< "P2 = " << typeid(P2
).name() << std::endl
;
23 return std::is_same
<P1
, P2
>::value
;
27 BOOST_AUTO_TEST_CASE( test_main
)
29 using namespace boost::math::policies
;
30 using namespace boost
;
32 BOOST_CHECK(check_same(make_policy(denorm_error
<ignore_error
>(), digits2
<20>()), make_policy(digits2
<20>(), denorm_error
<ignore_error
>())));
33 BOOST_CHECK(check_same(make_policy(denorm_error
<ignore_error
>(), promote_float
<false>()), make_policy(promote_float
<false>(), denorm_error
<ignore_error
>())));
34 BOOST_CHECK(check_same(make_policy(denorm_error
<ignore_error
>(), indeterminate_result_error
<ignore_error
>(), promote_float
<false>()), make_policy(indeterminate_result_error
<ignore_error
>(), promote_float
<false>(), denorm_error
<ignore_error
>())));
35 } // BOOST_AUTO_TEST_CASE( test_main )