From 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 20:24:20 +0200 Subject: Adding upstream version 14.2.21. Signed-off-by: Daniel Baumann --- src/boost/libs/math/test/test_policy_8.cpp | 50 ++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 src/boost/libs/math/test/test_policy_8.cpp (limited to 'src/boost/libs/math/test/test_policy_8.cpp') diff --git a/src/boost/libs/math/test/test_policy_8.cpp b/src/boost/libs/math/test/test_policy_8.cpp new file mode 100644 index 00000000..96d5e4e3 --- /dev/null +++ b/src/boost/libs/math/test/test_policy_8.cpp @@ -0,0 +1,50 @@ +#define BOOST_TEST_MAIN +// Copyright John Maddock 2007. + +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include // for test_main +#include + +template +bool check_same(const P1&, const P2&) +{ + if(!boost::is_same::value) + { + std::cout << "P1 = " << typeid(P1).name() << std::endl; + std::cout << "P2 = " << typeid(P2).name() << std::endl; + } + return boost::is_same::value; +} + + +BOOST_AUTO_TEST_CASE( test_main ) +{ + using namespace boost::math::policies; + using namespace boost; + + BOOST_CHECK(check_same(make_policy(domain_error()), policy >())); + BOOST_CHECK(check_same(make_policy(domain_error(), pole_error()), policy, pole_error >())); + BOOST_CHECK(check_same(make_policy(domain_error(), pole_error(), overflow_error()), policy, pole_error, overflow_error >())); + BOOST_CHECK(check_same(make_policy(domain_error(), pole_error(), overflow_error(), underflow_error()), policy, pole_error, overflow_error, underflow_error >())); + BOOST_CHECK(check_same(make_policy(domain_error(), pole_error(), overflow_error(), underflow_error(), denorm_error()), policy, pole_error, overflow_error, underflow_error, denorm_error >())); + BOOST_CHECK(check_same(make_policy(domain_error(), pole_error(), overflow_error(), underflow_error(), denorm_error(), evaluation_error()), policy, pole_error, overflow_error, underflow_error, denorm_error, evaluation_error >())); + BOOST_CHECK(check_same(make_policy(domain_error(), pole_error(), overflow_error(), underflow_error(), denorm_error(), evaluation_error(), indeterminate_result_error()), policy, pole_error, overflow_error, underflow_error, denorm_error, evaluation_error, indeterminate_result_error >())); + BOOST_CHECK(check_same(make_policy(domain_error(), pole_error(), overflow_error(), underflow_error(), denorm_error(), evaluation_error(), indeterminate_result_error(), digits2<10>()), policy, pole_error, overflow_error, underflow_error, denorm_error, evaluation_error, indeterminate_result_error, digits2<10> >())); + BOOST_CHECK(check_same(make_policy(domain_error(), pole_error(), overflow_error(), underflow_error(), denorm_error(), evaluation_error(), indeterminate_result_error(), digits10<5>()), policy, pole_error, overflow_error, underflow_error, denorm_error, evaluation_error, indeterminate_result_error, digits2<19> >())); + BOOST_CHECK(check_same(make_policy(domain_error(), pole_error(), overflow_error(), underflow_error(), denorm_error(), evaluation_error(), indeterminate_result_error(), digits2<10>(), promote_float()), policy, pole_error, overflow_error, underflow_error, denorm_error, evaluation_error, indeterminate_result_error, digits2<10>, promote_float >())); +#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS + BOOST_CHECK(check_same(make_policy(domain_error(), pole_error(), overflow_error(), underflow_error(), denorm_error(), evaluation_error(), indeterminate_result_error(), digits2<10>(), promote_float(), promote_double()), policy, pole_error, overflow_error, underflow_error, denorm_error, evaluation_error, indeterminate_result_error, digits2<10>, promote_float, promote_double >())); + BOOST_CHECK(check_same(make_policy(domain_error(), pole_error(), overflow_error(), underflow_error(), denorm_error(), evaluation_error(), indeterminate_result_error(), digits2<10>(), promote_float(), promote_double(), discrete_quantile()), policy, pole_error, overflow_error, underflow_error, denorm_error, evaluation_error, indeterminate_result_error, digits2<10>, promote_float, promote_double, discrete_quantile >())); +#endif + + +} // BOOST_AUTO_TEST_CASE( test_main ) + + + -- cgit v1.2.3