Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r50162 - trunk/libs/math/test
From: john_at_[hidden]
Date: 2008-12-06 11:07:42


Author: johnmaddock
Date: 2008-12-06 11:07:42 EST (Sat, 06 Dec 2008)
New Revision: 50162
URL: http://svn.boost.org/trac/boost/changeset/50162

Log:
Added debugging info to test case.
Text files modified:
   trunk/libs/math/test/test_classify.cpp | 36 ++++++++++++++++++++++++++++++++++++
   1 files changed, 36 insertions(+), 0 deletions(-)

Modified: trunk/libs/math/test/test_classify.cpp
==============================================================================
--- trunk/libs/math/test/test_classify.cpp (original)
+++ trunk/libs/math/test/test_classify.cpp 2008-12-06 11:07:42 EST (Sat, 06 Dec 2008)
@@ -15,10 +15,46 @@
 #pragma warning(disable: 4127) // conditional expression is constant
 #endif
 
+const char* method_name(const boost::math::detail::native_tag&)
+{
+ return "Native";
+}
+
+const char* method_name(const boost::math::detail::generic_tag<true>&)
+{
+ return "Generic (with numeric limits)";
+}
+
+const char* method_name(const boost::math::detail::generic_tag<false>&)
+{
+ return "Generic (without numeric limits)";
+}
+
+const char* method_name(const boost::math::detail::ieee_tag&)
+{
+ return "IEEE std";
+}
+
+const char* method_name(const boost::math::detail::ieee_copy_all_bits_tag&)
+{
+ return "IEEE std, copy all bits";
+}
+
+const char* method_name(const boost::math::detail::ieee_copy_leading_bits_tag&)
+{
+ return "IEEE std, copy leading bits";
+}
+
 template <class T>
 void test_classify(T t, const char* type)
 {
    std::cout << "Testing type " << type << std::endl;
+
+ typedef typename boost::math::detail::fp_traits<T>::type traits;
+ typedef typename traits::method method;
+
+ std::cout << "Evaluation method = " << method_name(method()) << std::endl;
+
    t = 2;
    T u = 2;
    BOOST_CHECK_EQUAL((::boost::math::fpclassify)(t), (int)FP_NORMAL);


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk