]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/math/test/test_policy_10.cpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / libs / math / test / test_policy_10.cpp
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>
10 #define BOOST_TEST_MAIN
11 #include <boost/test/unit_test.hpp> // for test_main
12 #include <iostream>
13 #include <type_traits>
14
15 template <class P1, class P2>
16 bool check_same(const P1&, const P2&)
17 {
18 if(!std::is_same<P1, P2>::value)
19 {
20 std::cout << "P1 = " << typeid(P1).name() << std::endl;
21 std::cout << "P2 = " << typeid(P2).name() << std::endl;
22 }
23 return std::is_same<P1, P2>::value;
24 }
25
26
27 BOOST_AUTO_TEST_CASE( test_main )
28 {
29 using namespace boost::math::policies;
30 using namespace boost;
31
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 )
36
37
38