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_5.cpp | 48 ++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/boost/libs/math/test/test_policy_5.cpp (limited to 'src/boost/libs/math/test/test_policy_5.cpp') diff --git a/src/boost/libs/math/test/test_policy_5.cpp b/src/boost/libs/math/test/test_policy_5.cpp new file mode 100644 index 00000000..ed3ee17e --- /dev/null +++ b/src/boost/libs/math/test/test_policy_5.cpp @@ -0,0 +1,48 @@ + +// 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 +#define BOOST_TEST_MAIN +#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((is_same, promote_float, discrete_quantile, denorm_error, domain_error > >::type::domain_error_type, domain_error >::value)); + BOOST_CHECK((is_same, promote_float, discrete_quantile, denorm_error, domain_error > >::type::pole_error_type, pole_error >::value)); + BOOST_CHECK((is_same, promote_float, discrete_quantile, denorm_error, domain_error > >::type::overflow_error_type, overflow_error >::value)); + BOOST_CHECK((is_same, promote_float, discrete_quantile, denorm_error, domain_error > >::type::underflow_error_type, underflow_error >::value)); + BOOST_CHECK((is_same, promote_float, discrete_quantile, denorm_error, domain_error > >::type::denorm_error_type, denorm_error >::value)); + BOOST_CHECK((is_same, promote_float, discrete_quantile, denorm_error, domain_error > >::type::evaluation_error_type, evaluation_error >::value)); + BOOST_CHECK((is_same, promote_float, discrete_quantile, denorm_error, domain_error > >::type::indeterminate_result_error_type, indeterminate_result_error >::value)); + BOOST_CHECK((is_same, promote_float, discrete_quantile, denorm_error, domain_error > >::type::precision_type, digits2<20> >::value)); + BOOST_CHECK((is_same, promote_float, discrete_quantile, denorm_error, domain_error > >::type::promote_float_type, promote_float >::value)); + BOOST_CHECK((is_same, promote_float, discrete_quantile, denorm_error, domain_error > >::type::promote_double_type, policy<>::promote_double_type>::value)); + BOOST_CHECK((is_same, promote_float, discrete_quantile, denorm_error, domain_error > >::type::discrete_quantile_type, discrete_quantile >::value)); + + +} // BOOST_AUTO_TEST_CASE( test_main ) + + + -- cgit v1.2.3