summaryrefslogtreecommitdiffstats
path: root/src/boost/libs/math/test/test_policy_7.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 18:24:20 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 18:24:20 +0000
commit483eb2f56657e8e7f419ab1a4fab8dce9ade8609 (patch)
treee5d88d25d870d5dedacb6bbdbe2a966086a0a5cf /src/boost/libs/math/test/test_policy_7.cpp
parentInitial commit. (diff)
downloadceph-upstream.tar.xz
ceph-upstream.zip
Adding upstream version 14.2.21.upstream/14.2.21upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/boost/libs/math/test/test_policy_7.cpp')
-rw-r--r--src/boost/libs/math/test/test_policy_7.cpp44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/boost/libs/math/test/test_policy_7.cpp b/src/boost/libs/math/test/test_policy_7.cpp
new file mode 100644
index 00000000..99792cea
--- /dev/null
+++ b/src/boost/libs/math/test/test_policy_7.cpp
@@ -0,0 +1,44 @@
+
+// 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 <boost/math/policies/policy.hpp>
+#include <boost/type_traits/is_same.hpp>
+#define BOOST_TEST_MAIN
+#include <boost/test/unit_test.hpp> // for test_main
+#include <iostream>
+
+template <class P1, class P2>
+bool check_same(const P1&, const P2&)
+{
+ if(!boost::is_same<P1, P2>::value)
+ {
+ std::cout << "P1 = " << typeid(P1).name() << std::endl;
+ std::cout << "P2 = " << typeid(P2).name() << std::endl;
+ }
+ return boost::is_same<P1, P2>::value;
+}
+
+
+BOOST_AUTO_TEST_CASE( test_main )
+{
+ using namespace boost::math::policies;
+ using namespace boost;
+
+ BOOST_CHECK(check_same(make_policy(), policy<>()));
+ BOOST_CHECK(check_same(make_policy(denorm_error<ignore_error>()), normalise<policy<denorm_error<ignore_error> > >::type()));
+ BOOST_CHECK(check_same(make_policy(digits2<20>()), normalise<policy<digits2<20> > >::type()));
+ BOOST_CHECK(check_same(make_policy(promote_float<false>()), normalise<policy<promote_float<false> > >::type()));
+ BOOST_CHECK(check_same(make_policy(domain_error<ignore_error>()), normalise<policy<domain_error<ignore_error> > >::type()));
+ BOOST_CHECK(check_same(make_policy(pole_error<ignore_error>()), normalise<policy<pole_error<ignore_error> > >::type()));
+ BOOST_CHECK(check_same(make_policy(indeterminate_result_error<ignore_error>()), normalise<policy<indeterminate_result_error<ignore_error> > >::type()));
+
+
+} // BOOST_AUTO_TEST_CASE( test_main )
+
+
+