Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r81497 - trunk/libs/multiprecision/test
From: john_at_[hidden]
Date: 2012-11-23 12:19:12


Author: johnmaddock
Date: 2012-11-23 12:19:11 EST (Fri, 23 Nov 2012)
New Revision: 81497
URL: http://svn.boost.org/trac/boost/changeset/81497

Log:
Improve testing macros and update test_arithmetic.cpp to use them and offer better error reporting.
Text files modified:
   trunk/libs/multiprecision/test/test.hpp | 28
   trunk/libs/multiprecision/test/test_arithmetic.cpp | 1247 +++++++++++++++++++--------------------
   2 files changed, 632 insertions(+), 643 deletions(-)

Modified: trunk/libs/multiprecision/test/test.hpp
==============================================================================
--- trunk/libs/multiprecision/test/test.hpp (original)
+++ trunk/libs/multiprecision/test/test.hpp 2012-11-23 12:19:11 EST (Fri, 23 Nov 2012)
@@ -37,7 +37,13 @@
 }
 
 template <class T>
-T relative_error(T a, T b)
+typename boost::enable_if_c<boost::multiprecision::number_category<T>::value == boost::multiprecision::number_kind_integer, T>::type relative_error(T a, T b)
+{
+ return a > b ? a - b : b - a;
+}
+
+template <class T>
+typename boost::disable_if_c<boost::multiprecision::number_category<T>::value == boost::multiprecision::number_kind_integer, T>::type relative_error(T a, T b)
 {
    using std::abs;
    using detail::abs;
@@ -47,6 +53,9 @@
 
    if((a != 0) && (b != 0))
    {
+ if(a == b)
+ return 0;
+
       // TODO: use isfinite:
       if(abs(b) >= max_val)
       {
@@ -75,6 +84,15 @@
    return (std::max)(abs(T((a-b)/a)), abs(T((a-b)/b))) / std::numeric_limits<T>::epsilon();
 }
 
+template <class T, class U>
+typename boost::mpl::if_c<boost::is_convertible<T, U>::value, U, T>::type
+ relative_error(T a, U b)
+{
+ typedef typename boost::mpl::if_c<boost::is_convertible<T, U>::value, U, T>::type cast_type;
+ return relative_error<cast_type>(static_cast<cast_type>(a), static_cast<cast_type>(b));
+}
+
+
 enum
 {
    warn_on_fail,
@@ -86,7 +104,7 @@
 inline T epsilon_of(const T&)
 {
    BOOST_STATIC_ASSERT(std::numeric_limits<T>::is_specialized);
- return std::numeric_limits<T>::epsilon();
+ return std::numeric_limits<T>::is_integer ? 1 : std::numeric_limits<T>::epsilon();
 }
 
 template <class T>
@@ -158,11 +176,11 @@
    }BOOST_MP_UNEXPECTED_EXCEPTION_CHECK(severity)
 
 #define BOOST_EQUAL_IMP(x, y, severity)\
- try{ if(x != y){\
+ try{ if(!((x) == (y))){\
    BOOST_MP_REPORT_WHERE << " Failed check for equality: \n" \
    << std::setprecision(digits_of(x)) << std::scientific\
- << "Value of LHS was: " << x << "\n"\
- << "Value of RHS was: " << y << "\n"\
+ << "Value of LHS was: " << (x) << "\n"\
+ << "Value of RHS was: " << (y) << "\n"\
    << std::setprecision(3) << std::endl;\
    BOOST_MP_REPORT_SEVERITY(severity);\
    }\

Modified: trunk/libs/multiprecision/test/test_arithmetic.cpp
==============================================================================
--- trunk/libs/multiprecision/test/test_arithmetic.cpp (original)
+++ trunk/libs/multiprecision/test/test_arithmetic.cpp 2012-11-23 12:19:11 EST (Fri, 23 Nov 2012)
@@ -74,20 +74,6 @@
 #pragma warning(disable:4127)
 #endif
 
-#define BOOST_TEST_THROW(x, EX)\
- try { x; BOOST_ERROR("Expected exception not thrown"); } \
- catch(const EX&){}\
- catch(...){ BOOST_ERROR("Incorrect exception type thrown"); }
-
-#undef BOOST_TEST
-#define BOOST_TEST(x)\
- try {\
- if(x){}else{ BOOST_ERROR("Value was zero: "); }\
- }\
- catch(const std::exception& e){ \
- BOOST_ERROR("Unexpected exception: ");\
- BOOST_LIGHTWEIGHT_TEST_OSTREAM << e.what() << std::endl;\
- }
 
 bool isfloat(float){ return true; }
 bool isfloat(double){ return true; }
@@ -106,18 +92,6 @@
 
 }
 
-#define BOOST_TEST_CLOSE(x, y, tol)\
- if(x == 0){\
- BOOST_TEST(y == 0); }\
- else if(!isfloat(x)){\
- BOOST_TEST(x == y); }\
- else if((x != y) && (detail::abs((x-y)/x) > tol))\
- {\
- BOOST_ERROR("Expected tolerance was exceeded: ");\
- BOOST_LIGHTWEIGHT_TEST_OSTREAM << std::setprecision(34) << "(x-y)/x = " << detail::abs((x-y)/x) \
- << " tolerance = " << tol << std::endl;\
- }
-
 template <class T>
 struct is_twos_complement_integer : public boost::mpl::true_ {};
 
@@ -134,9 +108,6 @@
 struct is_twos_complement_integer<boost::multiprecision::number<boost::multiprecision::cpp_int_backend<MinBits, MaxBits, SignType, boost::multiprecision::checked, Allocator>, ExpressionTemplates> > : public boost::mpl::false_ {};
 #endif
 
-#define BOOST_TEST_EQUAL(a, b) BOOST_TEST((a) == (b))
-
-
 template <class T>
 struct related_type
 {
@@ -210,66 +181,66 @@
 
    int cr = a < b ? -1 : a > b ? 1 : 0;
 
- BOOST_TEST_EQUAL(r1 == r2, a == b);
- BOOST_TEST_EQUAL(r1 != r2, a != b);
- BOOST_TEST_EQUAL(r1 <= r2, a <= b);
- BOOST_TEST_EQUAL(r1 < r2, a < b);
- BOOST_TEST_EQUAL(r1 >= r2, a >= b);
- BOOST_TEST_EQUAL(r1 > r2, a > b);
-
- BOOST_TEST_EQUAL(r1 == b, a == b);
- BOOST_TEST_EQUAL(r1 != b, a != b);
- BOOST_TEST_EQUAL(r1 <= b, a <= b);
- BOOST_TEST_EQUAL(r1 < b, a < b);
- BOOST_TEST_EQUAL(r1 >= b, a >= b);
- BOOST_TEST_EQUAL(r1 > b, a > b);
-
- BOOST_TEST_EQUAL(a == r2, a == b);
- BOOST_TEST_EQUAL(a != r2, a != b);
- BOOST_TEST_EQUAL(a <= r2, a <= b);
- BOOST_TEST_EQUAL(a < r2, a < b);
- BOOST_TEST_EQUAL(a >= r2, a >= b);
- BOOST_TEST_EQUAL(a > r2, a > b);
-
- BOOST_TEST_EQUAL(r1*z == r2, a == b);
- BOOST_TEST_EQUAL(r1*z != r2, a != b);
- BOOST_TEST_EQUAL(r1*z <= r2, a <= b);
- BOOST_TEST_EQUAL(r1*z < r2, a < b);
- BOOST_TEST_EQUAL(r1*z >= r2, a >= b);
- BOOST_TEST_EQUAL(r1*z > r2, a > b);
-
- BOOST_TEST_EQUAL(r1 == r2*z, a == b);
- BOOST_TEST_EQUAL(r1 != r2*z, a != b);
- BOOST_TEST_EQUAL(r1 <= r2*z, a <= b);
- BOOST_TEST_EQUAL(r1 < r2*z, a < b);
- BOOST_TEST_EQUAL(r1 >= r2*z, a >= b);
- BOOST_TEST_EQUAL(r1 > r2*z, a > b);
-
- BOOST_TEST_EQUAL(r1*z == r2*z, a == b);
- BOOST_TEST_EQUAL(r1*z != r2*z, a != b);
- BOOST_TEST_EQUAL(r1*z <= r2*z, a <= b);
- BOOST_TEST_EQUAL(r1*z < r2*z, a < b);
- BOOST_TEST_EQUAL(r1*z >= r2*z, a >= b);
- BOOST_TEST_EQUAL(r1*z > r2*z, a > b);
-
- BOOST_TEST_EQUAL(r1*z == b, a == b);
- BOOST_TEST_EQUAL(r1*z != b, a != b);
- BOOST_TEST_EQUAL(r1*z <= b, a <= b);
- BOOST_TEST_EQUAL(r1*z < b, a < b);
- BOOST_TEST_EQUAL(r1*z >= b, a >= b);
- BOOST_TEST_EQUAL(r1*z > b, a > b);
-
- BOOST_TEST_EQUAL(a == r2*z, a == b);
- BOOST_TEST_EQUAL(a != r2*z, a != b);
- BOOST_TEST_EQUAL(a <= r2*z, a <= b);
- BOOST_TEST_EQUAL(a < r2*z, a < b);
- BOOST_TEST_EQUAL(a >= r2*z, a >= b);
- BOOST_TEST_EQUAL(a > r2*z, a > b);
-
- BOOST_TEST_EQUAL(normalize_compare_result(r1.compare(r2)), cr);
- BOOST_TEST_EQUAL(normalize_compare_result(r2.compare(r1)), -cr);
- BOOST_TEST_EQUAL(normalize_compare_result(r1.compare(b)), cr);
- BOOST_TEST_EQUAL(normalize_compare_result(r2.compare(a)), -cr);
+ BOOST_CHECK_EQUAL(r1 == r2, a == b);
+ BOOST_CHECK_EQUAL(r1 != r2, a != b);
+ BOOST_CHECK_EQUAL(r1 <= r2, a <= b);
+ BOOST_CHECK_EQUAL(r1 < r2, a < b);
+ BOOST_CHECK_EQUAL(r1 >= r2, a >= b);
+ BOOST_CHECK_EQUAL(r1 > r2, a > b);
+
+ BOOST_CHECK_EQUAL(r1 == b, a == b);
+ BOOST_CHECK_EQUAL(r1 != b, a != b);
+ BOOST_CHECK_EQUAL(r1 <= b, a <= b);
+ BOOST_CHECK_EQUAL(r1 < b, a < b);
+ BOOST_CHECK_EQUAL(r1 >= b, a >= b);
+ BOOST_CHECK_EQUAL(r1 > b, a > b);
+
+ BOOST_CHECK_EQUAL(a == r2, a == b);
+ BOOST_CHECK_EQUAL(a != r2, a != b);
+ BOOST_CHECK_EQUAL(a <= r2, a <= b);
+ BOOST_CHECK_EQUAL(a < r2, a < b);
+ BOOST_CHECK_EQUAL(a >= r2, a >= b);
+ BOOST_CHECK_EQUAL(a > r2, a > b);
+
+ BOOST_CHECK_EQUAL(r1*z == r2, a == b);
+ BOOST_CHECK_EQUAL(r1*z != r2, a != b);
+ BOOST_CHECK_EQUAL(r1*z <= r2, a <= b);
+ BOOST_CHECK_EQUAL(r1*z < r2, a < b);
+ BOOST_CHECK_EQUAL(r1*z >= r2, a >= b);
+ BOOST_CHECK_EQUAL(r1*z > r2, a > b);
+
+ BOOST_CHECK_EQUAL(r1 == r2*z, a == b);
+ BOOST_CHECK_EQUAL(r1 != r2*z, a != b);
+ BOOST_CHECK_EQUAL(r1 <= r2*z, a <= b);
+ BOOST_CHECK_EQUAL(r1 < r2*z, a < b);
+ BOOST_CHECK_EQUAL(r1 >= r2*z, a >= b);
+ BOOST_CHECK_EQUAL(r1 > r2*z, a > b);
+
+ BOOST_CHECK_EQUAL(r1*z == r2*z, a == b);
+ BOOST_CHECK_EQUAL(r1*z != r2*z, a != b);
+ BOOST_CHECK_EQUAL(r1*z <= r2*z, a <= b);
+ BOOST_CHECK_EQUAL(r1*z < r2*z, a < b);
+ BOOST_CHECK_EQUAL(r1*z >= r2*z, a >= b);
+ BOOST_CHECK_EQUAL(r1*z > r2*z, a > b);
+
+ BOOST_CHECK_EQUAL(r1*z == b, a == b);
+ BOOST_CHECK_EQUAL(r1*z != b, a != b);
+ BOOST_CHECK_EQUAL(r1*z <= b, a <= b);
+ BOOST_CHECK_EQUAL(r1*z < b, a < b);
+ BOOST_CHECK_EQUAL(r1*z >= b, a >= b);
+ BOOST_CHECK_EQUAL(r1*z > b, a > b);
+
+ BOOST_CHECK_EQUAL(a == r2*z, a == b);
+ BOOST_CHECK_EQUAL(a != r2*z, a != b);
+ BOOST_CHECK_EQUAL(a <= r2*z, a <= b);
+ BOOST_CHECK_EQUAL(a < r2*z, a < b);
+ BOOST_CHECK_EQUAL(a >= r2*z, a >= b);
+ BOOST_CHECK_EQUAL(a > r2*z, a > b);
+
+ BOOST_CHECK_EQUAL(normalize_compare_result(r1.compare(r2)), cr);
+ BOOST_CHECK_EQUAL(normalize_compare_result(r2.compare(r1)), -cr);
+ BOOST_CHECK_EQUAL(normalize_compare_result(r1.compare(b)), cr);
+ BOOST_CHECK_EQUAL(normalize_compare_result(r2.compare(a)), -cr);
 }
 
 template <class Real, class Exp>
@@ -280,19 +251,19 @@
    //
    if(e)
    {
- BOOST_TEST(v);
+ BOOST_CHECK(v);
    }
    else
    {
- BOOST_TEST(!v);
+ BOOST_CHECK(!v);
    }
    if(!e)
    {
- BOOST_TEST(!v);
+ BOOST_CHECK(!v);
    }
    else
    {
- BOOST_TEST(v);
+ BOOST_CHECK(v);
    }
 }
 
@@ -304,15 +275,15 @@
    int sign_mask = ~0;
    if(std::numeric_limits<Real>::is_signed)
    {
- BOOST_TEST(~a == (~i & sign_mask));
+ BOOST_CHECK_EQUAL(~a , (~i & sign_mask));
       c = a & ~b;
- BOOST_TEST(c == (i & (~j & sign_mask)));
+ BOOST_CHECK_EQUAL(c , (i & (~j & sign_mask)));
       c = ~(a | b);
- BOOST_TEST(c == (~(i | j) & sign_mask));
+ BOOST_CHECK_EQUAL(c , (~(i | j) & sign_mask));
    }
    else
    {
- BOOST_TEST((~a & a) == 0);
+ BOOST_CHECK_EQUAL((~a & a) , 0);
    }
 }
 
@@ -329,11 +300,11 @@
 {
    Real a(2);
    a /= 3;
- BOOST_TEST(numerator(a) == 2);
- BOOST_TEST(denominator(a) == 3);
+ BOOST_CHECK_EQUAL(numerator(a) , 2);
+ BOOST_CHECK_EQUAL(denominator(a) , 3);
    Real b(4);
    b /= 6;
- BOOST_TEST(a == b);
+ BOOST_CHECK_EQUAL(a , b);
 
    //
    // Check IO code:
@@ -349,11 +320,11 @@
 {
    Real a(2);
    a /= 3;
- BOOST_TEST(numerator(a) == 2);
- BOOST_TEST(denominator(a) == 3);
+ BOOST_CHECK_EQUAL(numerator(a) , 2);
+ BOOST_CHECK_EQUAL(denominator(a) , 3);
    Real b(4);
    b /= 6;
- BOOST_TEST(a == b);
+ BOOST_CHECK_EQUAL(a , b);
 
    BOOST_CHECK_THROW(Real(a / 0), std::overflow_error);
    BOOST_CHECK_THROW(Real("3.14"), std::runtime_error);
@@ -380,101 +351,101 @@
    Real a(20);
    Real b(7);
    Real c(5);
- BOOST_TEST(-a % c == 0);
- BOOST_TEST(-a % b == -20 % 7);
- BOOST_TEST(-a % -b == -20 % -7);
- BOOST_TEST(a % -b == 20 % -7);
- BOOST_TEST(-a % 7 == -20 % 7);
- BOOST_TEST(-a % -7 == -20 % -7);
- BOOST_TEST(a % -7 == 20 % -7);
- BOOST_TEST(-a % 7u == -20 % 7);
- BOOST_TEST(-a % a == 0);
- BOOST_TEST(-a % 5 == 0);
- BOOST_TEST(-a % -5 == 0);
- BOOST_TEST(a % -5 == 0);
+ BOOST_CHECK_EQUAL(-a % c , 0);
+ BOOST_CHECK_EQUAL(-a % b , -20 % 7);
+ BOOST_CHECK_EQUAL(-a % -b , -20 % -7);
+ BOOST_CHECK_EQUAL(a % -b , 20 % -7);
+ BOOST_CHECK_EQUAL(-a % 7 , -20 % 7);
+ BOOST_CHECK_EQUAL(-a % -7 , -20 % -7);
+ BOOST_CHECK_EQUAL(a % -7 , 20 % -7);
+ BOOST_CHECK_EQUAL(-a % 7u , -20 % 7);
+ BOOST_CHECK_EQUAL(-a % a , 0);
+ BOOST_CHECK_EQUAL(-a % 5 , 0);
+ BOOST_CHECK_EQUAL(-a % -5 , 0);
+ BOOST_CHECK_EQUAL(a % -5 , 0);
 
    b = -b;
- BOOST_TEST(a % b == 20 % -7);
+ BOOST_CHECK_EQUAL(a % b , 20 % -7);
    a = -a;
- BOOST_TEST(a % b == -20 % -7);
- BOOST_TEST(a % -7 == -20 % -7);
+ BOOST_CHECK_EQUAL(a % b , -20 % -7);
+ BOOST_CHECK_EQUAL(a % -7 , -20 % -7);
    b = 7;
- BOOST_TEST(a % b == -20 % 7);
- BOOST_TEST(a % 7 == -20 % 7);
- BOOST_TEST(a % 7u == -20 % 7);
+ BOOST_CHECK_EQUAL(a % b , -20 % 7);
+ BOOST_CHECK_EQUAL(a % 7 , -20 % 7);
+ BOOST_CHECK_EQUAL(a % 7u , -20 % 7);
 
    a = 20;
    a %= b;
- BOOST_TEST(a == 20 % 7);
+ BOOST_CHECK_EQUAL(a , 20 % 7);
    a = -20;
    a %= b;
- BOOST_TEST(a == -20 % 7);
+ BOOST_CHECK_EQUAL(a , -20 % 7);
    a = 20;
    a %= -b;
- BOOST_TEST(a == 20 % -7);
+ BOOST_CHECK_EQUAL(a , 20 % -7);
    a = -20;
    a %= -b;
- BOOST_TEST(a == -20 % -7);
+ BOOST_CHECK_EQUAL(a , -20 % -7);
    a = 5;
    a %= b - a;
- BOOST_TEST(a == 5 % (7-5));
+ BOOST_CHECK_EQUAL(a , 5 % (7-5));
    a = -20;
    a %= 7;
- BOOST_TEST(a == -20 % 7);
+ BOOST_CHECK_EQUAL(a , -20 % 7);
    a = 20;
    a %= -7;
- BOOST_TEST(a == 20 % -7);
+ BOOST_CHECK_EQUAL(a , 20 % -7);
    a = -20;
    a %= -7;
- BOOST_TEST(a == -20 % -7);
+ BOOST_CHECK_EQUAL(a , -20 % -7);
 #ifndef BOOST_NO_LONG_LONG
    a = -20;
    a %= 7uLL;
- BOOST_TEST(a == -20 % 7);
+ BOOST_CHECK_EQUAL(a , -20 % 7);
    a = 20;
    a %= -7LL;
- BOOST_TEST(a == 20 % -7);
+ BOOST_CHECK_EQUAL(a , 20 % -7);
    a = -20;
    a %= -7LL;
- BOOST_TEST(a == -20 % -7);
+ BOOST_CHECK_EQUAL(a , -20 % -7);
 #endif
    a = 400;
    b = 45;
- BOOST_TEST(gcd(a, -45) == boost::math::gcd(400, 45));
- BOOST_TEST(lcm(a, -45) == boost::math::lcm(400, 45));
- BOOST_TEST(gcd(-400, b) == boost::math::gcd(400, 45));
- BOOST_TEST(lcm(-400, b) == boost::math::lcm(400, 45));
+ BOOST_CHECK_EQUAL(gcd(a, -45) , boost::math::gcd(400, 45));
+ BOOST_CHECK_EQUAL(lcm(a, -45) , boost::math::lcm(400, 45));
+ BOOST_CHECK_EQUAL(gcd(-400, b) , boost::math::gcd(400, 45));
+ BOOST_CHECK_EQUAL(lcm(-400, b) , boost::math::lcm(400, 45));
    a = -20;
- BOOST_TEST(abs(a) == 20);
- BOOST_TEST(abs(-a) == 20);
- BOOST_TEST(abs(+a) == 20);
- a = 20;
- BOOST_TEST(abs(a) == 20);
- BOOST_TEST(abs(-a) == 20);
- BOOST_TEST(abs(+a) == 20);
+ BOOST_CHECK_EQUAL(abs(a) , 20);
+ BOOST_CHECK_EQUAL(abs(-a) , 20);
+ BOOST_CHECK_EQUAL(abs(+a) , 20);
+ a = 20;
+ BOOST_CHECK_EQUAL(abs(a) , 20);
+ BOOST_CHECK_EQUAL(abs(-a) , 20);
+ BOOST_CHECK_EQUAL(abs(+a) , 20);
    a = -400;
    b = 45;
- BOOST_TEST(gcd(a, b) == boost::math::gcd(-400, 45));
- BOOST_TEST(lcm(a, b) == boost::math::lcm(-400, 45));
- BOOST_TEST(gcd(a, 45) == boost::math::gcd(-400, 45));
- BOOST_TEST(lcm(a, 45) == boost::math::lcm(-400, 45));
- BOOST_TEST(gcd(-400, b) == boost::math::gcd(-400, 45));
- BOOST_TEST(lcm(-400, b) == boost::math::lcm(-400, 45));
+ BOOST_CHECK_EQUAL(gcd(a, b) , boost::math::gcd(-400, 45));
+ BOOST_CHECK_EQUAL(lcm(a, b) , boost::math::lcm(-400, 45));
+ BOOST_CHECK_EQUAL(gcd(a, 45) , boost::math::gcd(-400, 45));
+ BOOST_CHECK_EQUAL(lcm(a, 45) , boost::math::lcm(-400, 45));
+ BOOST_CHECK_EQUAL(gcd(-400, b) , boost::math::gcd(-400, 45));
+ BOOST_CHECK_EQUAL(lcm(-400, b) , boost::math::lcm(-400, 45));
    Real r;
    divide_qr(a, b, c, r);
- BOOST_TEST(c == a / b);
- BOOST_TEST(r == a % b);
- BOOST_TEST(integer_modulus(a, 57) == abs(a % 57));
+ BOOST_CHECK_EQUAL(c , a / b);
+ BOOST_CHECK_EQUAL(r , a % b);
+ BOOST_CHECK_EQUAL(integer_modulus(a, 57) , abs(a % 57));
    b = -57;
    divide_qr(a, b, c, r);
- BOOST_TEST(c == a / b);
- BOOST_TEST(r == a % b);
- BOOST_TEST(integer_modulus(a, -57) == abs(a % -57));
+ BOOST_CHECK_EQUAL(c , a / b);
+ BOOST_CHECK_EQUAL(r , a % b);
+ BOOST_CHECK_EQUAL(integer_modulus(a, -57) , abs(a % -57));
    a = 458;
    divide_qr(a, b, c, r);
- BOOST_TEST(c == a / b);
- BOOST_TEST(r == a % b);
- BOOST_TEST(integer_modulus(a, -57) == abs(a % -57));
+ BOOST_CHECK_EQUAL(c , a / b);
+ BOOST_CHECK_EQUAL(r , a % b);
+ BOOST_CHECK_EQUAL(integer_modulus(a, -57) , abs(a % -57));
 }
 template <class Real>
 void test_signed_integer_ops(const boost::mpl::false_&)
@@ -489,88 +460,88 @@
    Real a(20);
    Real b(7);
    Real c(5);
- BOOST_TEST(a % b == 20 % 7);
- BOOST_TEST(a % 7 == 20 % 7);
- BOOST_TEST(a % 7u == 20 % 7);
- BOOST_TEST(a % a == 0);
- BOOST_TEST(a % c == 0);
- BOOST_TEST(a % 5 == 0);
+ BOOST_CHECK_EQUAL(a % b , 20 % 7);
+ BOOST_CHECK_EQUAL(a % 7 , 20 % 7);
+ BOOST_CHECK_EQUAL(a % 7u , 20 % 7);
+ BOOST_CHECK_EQUAL(a % a , 0);
+ BOOST_CHECK_EQUAL(a % c , 0);
+ BOOST_CHECK_EQUAL(a % 5 , 0);
    a = a % (b + 0);
- BOOST_TEST(a == 20 % 7);
+ BOOST_CHECK_EQUAL(a , 20 % 7);
    a = 20;
    c = (a + 2) % (a - 1);
- BOOST_TEST(c == 22 % 19);
+ BOOST_CHECK_EQUAL(c , 22 % 19);
    c = 5;
    a = b % (a - 15);
- BOOST_TEST(a == 7 % 5);
+ BOOST_CHECK_EQUAL(a , 7 % 5);
    a = 20;
 
    a = 20;
    a %= 7;
- BOOST_TEST(a == 20 % 7);
+ BOOST_CHECK_EQUAL(a , 20 % 7);
 #ifndef BOOST_NO_LONG_LONG
    a = 20;
    a %= 7uLL;
- BOOST_TEST(a == 20 % 7);
+ BOOST_CHECK_EQUAL(a , 20 % 7);
 #endif
    a = 20;
- BOOST_TEST(++a == 21);
- BOOST_TEST(--a == 20);
- BOOST_TEST(a++ == 20);
- BOOST_TEST(a == 21);
- BOOST_TEST(a-- == 21);
- BOOST_TEST(a == 20);
+ BOOST_CHECK_EQUAL(++a , 21);
+ BOOST_CHECK_EQUAL(--a , 20);
+ BOOST_CHECK_EQUAL(a++ , 20);
+ BOOST_CHECK_EQUAL(a , 21);
+ BOOST_CHECK_EQUAL(a-- , 21);
+ BOOST_CHECK_EQUAL(a , 20);
    a = 2000;
    a <<= 20;
- BOOST_TEST(a == 2000L << 20);
+ BOOST_CHECK_EQUAL(a , 2000L << 20);
    a >>= 20;
- BOOST_TEST(a == 2000);
+ BOOST_CHECK_EQUAL(a , 2000);
    a <<= 20u;
- BOOST_TEST(a == 2000L << 20);
+ BOOST_CHECK_EQUAL(a , 2000L << 20);
    a >>= 20u;
- BOOST_TEST(a == 2000);
- BOOST_TEST_THROW(a <<= -20, std::out_of_range);
- BOOST_TEST_THROW(a >>= -20, std::out_of_range);
- BOOST_TEST_THROW(Real(a << -20), std::out_of_range);
- BOOST_TEST_THROW(Real(a >> -20), std::out_of_range);
+ BOOST_CHECK_EQUAL(a , 2000);
+ BOOST_CHECK_THROW(a <<= -20, std::out_of_range);
+ BOOST_CHECK_THROW(a >>= -20, std::out_of_range);
+ BOOST_CHECK_THROW(Real(a << -20), std::out_of_range);
+ BOOST_CHECK_THROW(Real(a >> -20), std::out_of_range);
 #ifndef BOOST_NO_LONG_LONG
    if(sizeof(long long) > sizeof(std::size_t))
    {
       // extreme values should trigger an exception:
- BOOST_TEST_THROW(a >>= (1uLL << (sizeof(long long) * CHAR_BIT - 2)), std::out_of_range);
- BOOST_TEST_THROW(a <<= (1uLL << (sizeof(long long) * CHAR_BIT - 2)), std::out_of_range);
- BOOST_TEST_THROW(a >>= -(1LL << (sizeof(long long) * CHAR_BIT - 2)), std::out_of_range);
- BOOST_TEST_THROW(a <<= -(1LL << (sizeof(long long) * CHAR_BIT - 2)), std::out_of_range);
- BOOST_TEST_THROW(a >>= (1LL << (sizeof(long long) * CHAR_BIT - 2)), std::out_of_range);
- BOOST_TEST_THROW(a <<= (1LL << (sizeof(long long) * CHAR_BIT - 2)), std::out_of_range);
+ BOOST_CHECK_THROW(a >>= (1uLL << (sizeof(long long) * CHAR_BIT - 2)), std::out_of_range);
+ BOOST_CHECK_THROW(a <<= (1uLL << (sizeof(long long) * CHAR_BIT - 2)), std::out_of_range);
+ BOOST_CHECK_THROW(a >>= -(1LL << (sizeof(long long) * CHAR_BIT - 2)), std::out_of_range);
+ BOOST_CHECK_THROW(a <<= -(1LL << (sizeof(long long) * CHAR_BIT - 2)), std::out_of_range);
+ BOOST_CHECK_THROW(a >>= (1LL << (sizeof(long long) * CHAR_BIT - 2)), std::out_of_range);
+ BOOST_CHECK_THROW(a <<= (1LL << (sizeof(long long) * CHAR_BIT - 2)), std::out_of_range);
       // Unless they fit within range:
       a = 2000L;
- BOOST_TEST((a <<= 20uLL) == (2000L << 20));
+ BOOST_CHECK_EQUAL((a <<= 20uLL) , (2000L << 20));
       a = 2000;
- BOOST_TEST((a <<= 20LL) == (2000L << 20));
+ BOOST_CHECK_EQUAL((a <<= 20LL) , (2000L << 20));
 
- BOOST_TEST_THROW(Real(a >> (1uLL << (sizeof(long long) * CHAR_BIT - 2))), std::out_of_range);
- BOOST_TEST_THROW(Real(a <<= (1uLL << (sizeof(long long) * CHAR_BIT - 2))), std::out_of_range);
- BOOST_TEST_THROW(Real(a >>= -(1LL << (sizeof(long long) * CHAR_BIT - 2))), std::out_of_range);
- BOOST_TEST_THROW(Real(a <<= -(1LL << (sizeof(long long) * CHAR_BIT - 2))), std::out_of_range);
- BOOST_TEST_THROW(Real(a >>= (1LL << (sizeof(long long) * CHAR_BIT - 2))), std::out_of_range);
- BOOST_TEST_THROW(Real(a <<= (1LL << (sizeof(long long) * CHAR_BIT - 2))), std::out_of_range);
+ BOOST_CHECK_THROW(Real(a >> (1uLL << (sizeof(long long) * CHAR_BIT - 2))), std::out_of_range);
+ BOOST_CHECK_THROW(Real(a <<= (1uLL << (sizeof(long long) * CHAR_BIT - 2))), std::out_of_range);
+ BOOST_CHECK_THROW(Real(a >>= -(1LL << (sizeof(long long) * CHAR_BIT - 2))), std::out_of_range);
+ BOOST_CHECK_THROW(Real(a <<= -(1LL << (sizeof(long long) * CHAR_BIT - 2))), std::out_of_range);
+ BOOST_CHECK_THROW(Real(a >>= (1LL << (sizeof(long long) * CHAR_BIT - 2))), std::out_of_range);
+ BOOST_CHECK_THROW(Real(a <<= (1LL << (sizeof(long long) * CHAR_BIT - 2))), std::out_of_range);
       // Unless they fit within range:
       a = 2000L;
- BOOST_TEST(Real(a << 20uLL) == (2000L << 20));
+ BOOST_CHECK_EQUAL(Real(a << 20uLL) , (2000L << 20));
       a = 2000;
- BOOST_TEST(Real(a << 20LL) == (2000L << 20));
+ BOOST_CHECK_EQUAL(Real(a << 20LL) , (2000L << 20));
    }
 #endif
    a = 20;
    b = a << 20;
- BOOST_TEST(b == (20 << 20));
+ BOOST_CHECK_EQUAL(b , (20 << 20));
    b = a >> 2;
- BOOST_TEST(b == (20 >> 2));
+ BOOST_CHECK_EQUAL(b , (20 >> 2));
    b = (a + 2) << 10;
- BOOST_TEST(b == (22 << 10));
+ BOOST_CHECK_EQUAL(b , (22 << 10));
    b = (a + 3) >> 3;
- BOOST_TEST(b == (23 >> 3));
+ BOOST_CHECK_EQUAL(b , (23 >> 3));
    //
    // Bit fiddling:
    //
@@ -581,28 +552,28 @@
    b = j;
    c = a;
    c &= b;
- BOOST_TEST(c == (i & j));
+ BOOST_CHECK_EQUAL(c , (i & j));
    c = a;
    c &= j;
- BOOST_TEST(c == (i & j));
+ BOOST_CHECK_EQUAL(c , (i & j));
    c = a;
    c &= a + b;
- BOOST_TEST(c == (i & (i + j)));
- BOOST_TEST((a & b) == (i & j));
+ BOOST_CHECK_EQUAL(c , (i & (i + j)));
+ BOOST_CHECK_EQUAL((a & b) , (i & j));
    c = k;
    a = a & (b + k);
- BOOST_TEST(a == (i & (j + k)));
+ BOOST_CHECK_EQUAL(a , (i & (j + k)));
    a = i;
    a = (b + k) & a;
- BOOST_TEST(a == (i & (j + k)));
+ BOOST_CHECK_EQUAL(a , (i & (j + k)));
    a = i;
    c = a & b & k;
- BOOST_TEST(c == (i&j&k));
+ BOOST_CHECK_EQUAL(c , (i&j&k));
    c = a;
    c &= (c+b);
- BOOST_TEST(c == (i & (i+j)));
+ BOOST_CHECK_EQUAL(c , (i & (i+j)));
    c = a & (b | 1);
- BOOST_TEST(c == (i & (j | 1)));
+ BOOST_CHECK_EQUAL(c , (i & (j | 1)));
 
    test_complement<Real>(a, b, c, typename is_twos_complement_integer<Real>::type());
 
@@ -610,55 +581,55 @@
    b = j;
    c = a;
    c |= b;
- BOOST_TEST(c == (i | j));
+ BOOST_CHECK_EQUAL(c , (i | j));
    c = a;
    c |= j;
- BOOST_TEST(c == (i | j));
+ BOOST_CHECK_EQUAL(c , (i | j));
    c = a;
    c |= a + b;
- BOOST_TEST(c == (i | (i + j)));
- BOOST_TEST((a | b) == (i | j));
+ BOOST_CHECK_EQUAL(c , (i | (i + j)));
+ BOOST_CHECK_EQUAL((a | b) , (i | j));
    c = k;
    a = a | (b + k);
- BOOST_TEST(a == (i | (j + k)));
+ BOOST_CHECK_EQUAL(a , (i | (j + k)));
    a = i;
    a = (b + k) | a;
- BOOST_TEST(a == (i | (j + k)));
+ BOOST_CHECK_EQUAL(a , (i | (j + k)));
    a = i;
    c = a | b | k;
- BOOST_TEST(c == (i|j|k));
+ BOOST_CHECK_EQUAL(c , (i|j|k));
    c = a;
    c |= (c + b);
- BOOST_TEST(c == (i | (i+j)));
+ BOOST_CHECK_EQUAL(c , (i | (i+j)));
    c = a | (b | 1);
- BOOST_TEST(c == (i | (j | 1)));
+ BOOST_CHECK_EQUAL(c , (i | (j | 1)));
 
    a = i;
    b = j;
    c = a;
    c ^= b;
- BOOST_TEST(c == (i ^ j));
+ BOOST_CHECK_EQUAL(c , (i ^ j));
    c = a;
    c ^= j;
- BOOST_TEST(c == (i ^ j));
+ BOOST_CHECK_EQUAL(c , (i ^ j));
    c = a;
    c ^= a + b;
- BOOST_TEST(c == (i ^ (i + j)));
- BOOST_TEST((a ^ b) == (i ^ j));
+ BOOST_CHECK_EQUAL(c , (i ^ (i + j)));
+ BOOST_CHECK_EQUAL((a ^ b) , (i ^ j));
    c = k;
    a = a ^ (b + k);
- BOOST_TEST(a == (i ^ (j + k)));
+ BOOST_CHECK_EQUAL(a , (i ^ (j + k)));
    a = i;
    a = (b + k) ^ a;
- BOOST_TEST(a == (i ^ (j + k)));
+ BOOST_CHECK_EQUAL(a , (i ^ (j + k)));
    a = i;
    c = a ^ b ^ k;
- BOOST_TEST(c == (i^j^k));
+ BOOST_CHECK_EQUAL(c , (i^j^k));
    c = a;
    c ^= (c + b);
- BOOST_TEST(c == (i ^ (i+j)));
+ BOOST_CHECK_EQUAL(c , (i ^ (i+j)));
    c = a ^ (b | 1);
- BOOST_TEST(c == (i ^ (j | 1)));
+ BOOST_CHECK_EQUAL(c , (i ^ (j | 1)));
 
    a = i;
    b = j;
@@ -668,16 +639,16 @@
    //
    a = 400;
    b = 45;
- BOOST_TEST(gcd(a, b) == boost::math::gcd(400, 45));
- BOOST_TEST(lcm(a, b) == boost::math::lcm(400, 45));
- BOOST_TEST(gcd(a, 45) == boost::math::gcd(400, 45));
- BOOST_TEST(lcm(a, 45) == boost::math::lcm(400, 45));
- BOOST_TEST(gcd(a, 45u) == boost::math::gcd(400, 45));
- BOOST_TEST(lcm(a, 45u) == boost::math::lcm(400, 45));
- BOOST_TEST(gcd(400, b) == boost::math::gcd(400, 45));
- BOOST_TEST(lcm(400, b) == boost::math::lcm(400, 45));
- BOOST_TEST(gcd(400u, b) == boost::math::gcd(400, 45));
- BOOST_TEST(lcm(400u, b) == boost::math::lcm(400, 45));
+ BOOST_CHECK_EQUAL(gcd(a, b) , boost::math::gcd(400, 45));
+ BOOST_CHECK_EQUAL(lcm(a, b) , boost::math::lcm(400, 45));
+ BOOST_CHECK_EQUAL(gcd(a, 45) , boost::math::gcd(400, 45));
+ BOOST_CHECK_EQUAL(lcm(a, 45) , boost::math::lcm(400, 45));
+ BOOST_CHECK_EQUAL(gcd(a, 45u) , boost::math::gcd(400, 45));
+ BOOST_CHECK_EQUAL(lcm(a, 45u) , boost::math::lcm(400, 45));
+ BOOST_CHECK_EQUAL(gcd(400, b) , boost::math::gcd(400, 45));
+ BOOST_CHECK_EQUAL(lcm(400, b) , boost::math::lcm(400, 45));
+ BOOST_CHECK_EQUAL(gcd(400u, b) , boost::math::gcd(400, 45));
+ BOOST_CHECK_EQUAL(lcm(400u, b) , boost::math::lcm(400, 45));
 
    //
    // Conditionals involving 2 arg functions:
@@ -686,62 +657,62 @@
 
    Real r;
    divide_qr(a, b, c, r);
- BOOST_TEST(c == a / b);
- BOOST_TEST(r == a % b);
+ BOOST_CHECK_EQUAL(c , a / b);
+ BOOST_CHECK_EQUAL(r , a % b);
    divide_qr(a + 0, b, c, r);
- BOOST_TEST(c == a / b);
- BOOST_TEST(r == a % b);
+ BOOST_CHECK_EQUAL(c , a / b);
+ BOOST_CHECK_EQUAL(r , a % b);
    divide_qr(a, b+0, c, r);
- BOOST_TEST(c == a / b);
- BOOST_TEST(r == a % b);
+ BOOST_CHECK_EQUAL(c , a / b);
+ BOOST_CHECK_EQUAL(r , a % b);
    divide_qr(a+0, b+0, c, r);
- BOOST_TEST(c == a / b);
- BOOST_TEST(r == a % b);
- BOOST_TEST(integer_modulus(a, 57) == a % 57);
+ BOOST_CHECK_EQUAL(c , a / b);
+ BOOST_CHECK_EQUAL(r , a % b);
+ BOOST_CHECK_EQUAL(integer_modulus(a, 57) , a % 57);
    for(unsigned i = 0; i < 20; ++i)
    {
       if(std::numeric_limits<Real>::is_specialized && (!std::numeric_limits<Real>::is_bounded || ((int)i * 17 < std::numeric_limits<Real>::digits)))
       {
- BOOST_TEST(lsb(Real(1) << (i * 17)) == i * 17);
- BOOST_TEST(bit_test(Real(1) << (i * 17), i * 17));
- BOOST_TEST(!bit_test(Real(1) << (i * 17), i * 17 + 1));
+ BOOST_CHECK_EQUAL(lsb(Real(1) << (i * 17)) , i * 17);
+ BOOST_CHECK(bit_test(Real(1) << (i * 17), i * 17));
+ BOOST_CHECK(!bit_test(Real(1) << (i * 17), i * 17 + 1));
          if(i)
          {
- BOOST_TEST(!bit_test(Real(1) << (i * 17), i * 17 - 1));
+ BOOST_CHECK(!bit_test(Real(1) << (i * 17), i * 17 - 1));
          }
          Real zero(0);
- BOOST_TEST(bit_test(bit_set(zero, i * 17), i * 17));
+ BOOST_CHECK(bit_test(bit_set(zero, i * 17), i * 17));
          zero = 0;
- BOOST_TEST(bit_flip(zero, i*17) == Real(1) << i * 17);
+ BOOST_CHECK_EQUAL(bit_flip(zero, i*17) , Real(1) << i * 17);
          zero = Real(1) << i * 17;
- BOOST_TEST(bit_flip(zero, i * 17) == 0);
+ BOOST_CHECK_EQUAL(bit_flip(zero, i * 17) , 0);
          zero = Real(1) << i * 17;
- BOOST_TEST(bit_unset(zero, i * 17) == 0);
+ BOOST_CHECK_EQUAL(bit_unset(zero, i * 17) , 0);
       }
    }
    //
    // pow, powm:
    //
- BOOST_TEST(pow(Real(3), 4) == 81);
- BOOST_TEST(pow(Real(3) + Real(0), 4) == 81);
- BOOST_TEST(powm(Real(3), Real(4), Real(13)) == 81 % 13);
- BOOST_TEST(powm(Real(3), Real(4), 13) == 81 % 13);
- BOOST_TEST(powm(Real(3), Real(4), Real(13) + 0) == 81 % 13);
- BOOST_TEST(powm(Real(3), Real(4) + 0, Real(13)) == 81 % 13);
- BOOST_TEST(powm(Real(3), Real(4) + 0, 13) == 81 % 13);
- BOOST_TEST(powm(Real(3), Real(4) + 0, Real(13) + 0) == 81 % 13);
- BOOST_TEST(powm(Real(3), 4 + 0, Real(13)) == 81 % 13);
- BOOST_TEST(powm(Real(3), 4 + 0, 13) == 81 % 13);
- BOOST_TEST(powm(Real(3), 4 + 0, Real(13) + 0) == 81 % 13);
- BOOST_TEST(powm(Real(3) + 0, Real(4), Real(13)) == 81 % 13);
- BOOST_TEST(powm(Real(3) + 0, Real(4), 13) == 81 % 13);
- BOOST_TEST(powm(Real(3) + 0, Real(4), Real(13) + 0) == 81 % 13);
- BOOST_TEST(powm(Real(3) + 0, Real(4) + 0, Real(13)) == 81 % 13);
- BOOST_TEST(powm(Real(3) + 0, Real(4) + 0, 13) == 81 % 13);
- BOOST_TEST(powm(Real(3) + 0, Real(4) + 0, Real(13) + 0) == 81 % 13);
- BOOST_TEST(powm(Real(3) + 0, 4 + 0, Real(13)) == 81 % 13);
- BOOST_TEST(powm(Real(3) + 0, 4 + 0, 13) == 81 % 13);
- BOOST_TEST(powm(Real(3) + 0, 4 + 0, Real(13) + 0) == 81 % 13);
+ BOOST_CHECK_EQUAL(pow(Real(3), 4) , 81);
+ BOOST_CHECK_EQUAL(pow(Real(3) + Real(0), 4) , 81);
+ BOOST_CHECK_EQUAL(powm(Real(3), Real(4), Real(13)) , 81 % 13);
+ BOOST_CHECK_EQUAL(powm(Real(3), Real(4), 13) , 81 % 13);
+ BOOST_CHECK_EQUAL(powm(Real(3), Real(4), Real(13) + 0) , 81 % 13);
+ BOOST_CHECK_EQUAL(powm(Real(3), Real(4) + 0, Real(13)) , 81 % 13);
+ BOOST_CHECK_EQUAL(powm(Real(3), Real(4) + 0, 13) , 81 % 13);
+ BOOST_CHECK_EQUAL(powm(Real(3), Real(4) + 0, Real(13) + 0) , 81 % 13);
+ BOOST_CHECK_EQUAL(powm(Real(3), 4 + 0, Real(13)) , 81 % 13);
+ BOOST_CHECK_EQUAL(powm(Real(3), 4 + 0, 13) , 81 % 13);
+ BOOST_CHECK_EQUAL(powm(Real(3), 4 + 0, Real(13) + 0) , 81 % 13);
+ BOOST_CHECK_EQUAL(powm(Real(3) + 0, Real(4), Real(13)) , 81 % 13);
+ BOOST_CHECK_EQUAL(powm(Real(3) + 0, Real(4), 13) , 81 % 13);
+ BOOST_CHECK_EQUAL(powm(Real(3) + 0, Real(4), Real(13) + 0) , 81 % 13);
+ BOOST_CHECK_EQUAL(powm(Real(3) + 0, Real(4) + 0, Real(13)) , 81 % 13);
+ BOOST_CHECK_EQUAL(powm(Real(3) + 0, Real(4) + 0, 13) , 81 % 13);
+ BOOST_CHECK_EQUAL(powm(Real(3) + 0, Real(4) + 0, Real(13) + 0) , 81 % 13);
+ BOOST_CHECK_EQUAL(powm(Real(3) + 0, 4 + 0, Real(13)) , 81 % 13);
+ BOOST_CHECK_EQUAL(powm(Real(3) + 0, 4 + 0, 13) , 81 % 13);
+ BOOST_CHECK_EQUAL(powm(Real(3) + 0, 4 + 0, Real(13) + 0) , 81 % 13);
    //
    // Conditionals involving 3 arg functions:
    //
@@ -759,31 +730,31 @@
    a = 20;
    b = 7;
    c = 20 % b;
- BOOST_TEST(c == (20 % 7));
+ BOOST_CHECK_EQUAL(c , (20 % 7));
    c = 20 % (b + 0);
- BOOST_TEST(c == (20 % 7));
+ BOOST_CHECK_EQUAL(c , (20 % 7));
    c = a & 10;
- BOOST_TEST(c == (20 & 10));
+ BOOST_CHECK_EQUAL(c , (20 & 10));
    c = 10 & a;
- BOOST_TEST(c == (20 & 10));
+ BOOST_CHECK_EQUAL(c , (20 & 10));
    c = (a + 0) & (b + 0);
- BOOST_TEST(c == (20 & 7));
+ BOOST_CHECK_EQUAL(c , (20 & 7));
    c = 10 & (a + 0);
- BOOST_TEST(c == (20 & 10));
+ BOOST_CHECK_EQUAL(c , (20 & 10));
    c = 10 | a;
- BOOST_TEST(c == (20 | 10));
+ BOOST_CHECK_EQUAL(c , (20 | 10));
    c = (a + 0) | (b + 0);
- BOOST_TEST(c == (20 | 7))
+ BOOST_CHECK(c == (20 | 7))
    c = 20 | (b + 0);
- BOOST_TEST(c == (20 | 7));
+ BOOST_CHECK_EQUAL(c , (20 | 7));
    c = a ^ 7;
- BOOST_TEST(c == (20 ^ 7));
+ BOOST_CHECK_EQUAL(c , (20 ^ 7));
    c = 20 ^ b;
- BOOST_TEST(c == (20 ^ 7));
+ BOOST_CHECK_EQUAL(c , (20 ^ 7));
    c = (a + 0) ^ (b + 0);
- BOOST_TEST(c == (20 ^ 7));
+ BOOST_CHECK_EQUAL(c , (20 ^ 7));
    c = 20 ^ (b + 0);
- BOOST_TEST(c == (20 ^ 7));
+ BOOST_CHECK_EQUAL(c , (20 ^ 7));
 }
 
 template <class Real, class T>
@@ -792,64 +763,64 @@
 template <class Real>
 void test_float_ops(const boost::mpl::int_<boost::multiprecision::number_kind_floating_point>&)
 {
- BOOST_TEST(abs(Real(2)) == 2);
- BOOST_TEST(abs(Real(-2)) == 2);
- BOOST_TEST(fabs(Real(2)) == 2);
- BOOST_TEST(fabs(Real(-2)) == 2);
- BOOST_TEST(floor(Real(5) / 2) == 2);
- BOOST_TEST(ceil(Real(5) / 2) == 3);
- BOOST_TEST(floor(Real(-5) / 2) == -3);
- BOOST_TEST(ceil(Real(-5) / 2) == -2);
- BOOST_TEST(trunc(Real(5) / 2) == 2);
- BOOST_TEST(trunc(Real(-5) / 2) == -2);
+ BOOST_CHECK_EQUAL(abs(Real(2)) , 2);
+ BOOST_CHECK_EQUAL(abs(Real(-2)) , 2);
+ BOOST_CHECK_EQUAL(fabs(Real(2)) , 2);
+ BOOST_CHECK_EQUAL(fabs(Real(-2)) , 2);
+ BOOST_CHECK_EQUAL(floor(Real(5) / 2) , 2);
+ BOOST_CHECK_EQUAL(ceil(Real(5) / 2) , 3);
+ BOOST_CHECK_EQUAL(floor(Real(-5) / 2) , -3);
+ BOOST_CHECK_EQUAL(ceil(Real(-5) / 2) , -2);
+ BOOST_CHECK_EQUAL(trunc(Real(5) / 2) , 2);
+ BOOST_CHECK_EQUAL(trunc(Real(-5) / 2) , -2);
    //
    // ldexp and frexp, these pretty much have to be implemented by each backend:
    //
- BOOST_TEST(ldexp(Real(2), 5) == 64);
- BOOST_TEST(ldexp(Real(2), -5) == Real(2) / 32);
+ BOOST_CHECK_EQUAL(ldexp(Real(2), 5) , 64);
+ BOOST_CHECK_EQUAL(ldexp(Real(2), -5) , Real(2) / 32);
    Real v(512);
    int exp;
    Real r = frexp(v, &exp);
- BOOST_TEST(r == 0.5);
- BOOST_TEST(exp == 10);
- BOOST_TEST(v == 512);
+ BOOST_CHECK_EQUAL(r , 0.5);
+ BOOST_CHECK_EQUAL(exp , 10);
+ BOOST_CHECK_EQUAL(v , 512);
    v = 1 / v;
    r = frexp(v, &exp);
- BOOST_TEST(r == 0.5);
- BOOST_TEST(exp == -8);
+ BOOST_CHECK_EQUAL(r , 0.5);
+ BOOST_CHECK_EQUAL(exp , -8);
    typedef typename Real::backend_type::exponent_type e_type;
- BOOST_TEST(ldexp(Real(2), e_type(5)) == 64);
- BOOST_TEST(ldexp(Real(2), e_type(-5)) == Real(2) / 32);
+ BOOST_CHECK_EQUAL(ldexp(Real(2), e_type(5)) , 64);
+ BOOST_CHECK_EQUAL(ldexp(Real(2), e_type(-5)) , Real(2) / 32);
    v = 512;
    e_type exp2;
    r = frexp(v, &exp2);
- BOOST_TEST(r == 0.5);
- BOOST_TEST(exp2 == 10);
- BOOST_TEST(v == 512);
+ BOOST_CHECK_EQUAL(r , 0.5);
+ BOOST_CHECK_EQUAL(exp2 , 10);
+ BOOST_CHECK_EQUAL(v , 512);
    v = 1 / v;
    r = frexp(v, &exp2);
- BOOST_TEST(r == 0.5);
- BOOST_TEST(exp2 == -8);
+ BOOST_CHECK_EQUAL(r , 0.5);
+ BOOST_CHECK_EQUAL(exp2 , -8);
    //
    // pow and exp:
    //
    v = 3.25;
    r = pow(v, 0);
- BOOST_TEST(r == 1);
+ BOOST_CHECK_EQUAL(r , 1);
    r = pow(v, 1);
- BOOST_TEST(r == 3.25);
+ BOOST_CHECK_EQUAL(r , 3.25);
    r = pow(v, 2);
- BOOST_TEST(r == boost::math::pow<2>(3.25));
+ BOOST_CHECK_EQUAL(r , boost::math::pow<2>(3.25));
    r = pow(v, 3);
- BOOST_TEST(r == boost::math::pow<3>(3.25));
+ BOOST_CHECK_EQUAL(r , boost::math::pow<3>(3.25));
    r = pow(v, 4);
- BOOST_TEST(r == boost::math::pow<4>(3.25));
+ BOOST_CHECK_EQUAL(r , boost::math::pow<4>(3.25));
    r = pow(v, 5);
- BOOST_TEST(r == boost::math::pow<5>(3.25));
+ BOOST_CHECK_EQUAL(r , boost::math::pow<5>(3.25));
    r = pow(v, 6);
- BOOST_TEST(r == boost::math::pow<6>(3.25));
+ BOOST_CHECK_EQUAL(r , boost::math::pow<6>(3.25));
    r = pow(v, 25);
- BOOST_TEST(r == boost::math::pow<25>(Real(3.25)));
+ BOOST_CHECK_EQUAL(r , boost::math::pow<25>(Real(3.25)));
    //
    // Things that are expected errors:
    //
@@ -911,23 +882,23 @@
    test_comparisons<Real>(n3, n3, boost::is_convertible<Num, Real>());
 
    // Default construct:
- BOOST_TEST(Real(n1) == static_cast<cast_type>(n1));
- BOOST_TEST(Real(n2) == static_cast<cast_type>(n2));
- BOOST_TEST(Real(n3) == static_cast<cast_type>(n3));
- BOOST_TEST(Real(n4) == static_cast<cast_type>(n4));
- BOOST_TEST(static_cast<cast_type>(n1) == Real(n1));
- BOOST_TEST(static_cast<cast_type>(n2) == Real(n2));
- BOOST_TEST(static_cast<cast_type>(n3) == Real(n3));
- BOOST_TEST(static_cast<cast_type>(n4) == Real(n4));
- BOOST_TEST(Real(n1).template convert_to<Num>() == n1);
- BOOST_TEST(Real(n2).template convert_to<Num>() == n2);
- BOOST_TEST(Real(n3).template convert_to<Num>() == n3);
- BOOST_TEST(Real(n4).template convert_to<Num>() == n4);
+ BOOST_CHECK_EQUAL(Real(n1) , static_cast<cast_type>(n1));
+ BOOST_CHECK_EQUAL(Real(n2) , static_cast<cast_type>(n2));
+ BOOST_CHECK_EQUAL(Real(n3) , static_cast<cast_type>(n3));
+ BOOST_CHECK_EQUAL(Real(n4) , static_cast<cast_type>(n4));
+ BOOST_CHECK_EQUAL(static_cast<cast_type>(n1) , Real(n1));
+ BOOST_CHECK_EQUAL(static_cast<cast_type>(n2) , Real(n2));
+ BOOST_CHECK_EQUAL(static_cast<cast_type>(n3) , Real(n3));
+ BOOST_CHECK_EQUAL(static_cast<cast_type>(n4) , Real(n4));
+ BOOST_CHECK_EQUAL(Real(n1).template convert_to<Num>() , n1);
+ BOOST_CHECK_EQUAL(Real(n2).template convert_to<Num>() , n2);
+ BOOST_CHECK_EQUAL(Real(n3).template convert_to<Num>() , n3);
+ BOOST_CHECK_EQUAL(Real(n4).template convert_to<Num>() , n4);
 #ifndef BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
- BOOST_TEST(static_cast<Num>(Real(n1)) == n1);
- BOOST_TEST(static_cast<Num>(Real(n2)) == n2);
- BOOST_TEST(static_cast<Num>(Real(n3)) == n3);
- BOOST_TEST(static_cast<Num>(Real(n4)) == n4);
+ BOOST_CHECK_EQUAL(static_cast<Num>(Real(n1)) , n1);
+ BOOST_CHECK_EQUAL(static_cast<Num>(Real(n2)) , n2);
+ BOOST_CHECK_EQUAL(static_cast<Num>(Real(n3)) , n3);
+ BOOST_CHECK_EQUAL(static_cast<Num>(Real(n4)) , n4);
 #endif
 #if defined(TEST_MPFR) || defined(TEST_MPFR_50)
    Num tol = 10 * std::numeric_limits<Num>::epsilon();
@@ -937,150 +908,150 @@
    std::ios_base::fmtflags f = boost::is_floating_point<Num>::value ? std::ios_base::scientific : std::ios_base::fmtflags(0);
    if(std::numeric_limits<target_type>::digits <= std::numeric_limits<Real>::digits)
    {
- BOOST_TEST_CLOSE(n1, boost::lexical_cast<target_type>(Real(n1).str(0, f)), tol);
+ BOOST_CHECK_CLOSE(n1, boost::lexical_cast<target_type>(Real(n1).str(0, f)), tol);
    }
- BOOST_TEST_CLOSE(n2, boost::lexical_cast<target_type>(Real(n2).str(0, f)), 0);
- BOOST_TEST_CLOSE(n3, boost::lexical_cast<target_type>(Real(n3).str(0, f)), 0);
- BOOST_TEST_CLOSE(n4, boost::lexical_cast<target_type>(Real(n4).str(0, f)), 0);
+ BOOST_CHECK_CLOSE(n2, boost::lexical_cast<target_type>(Real(n2).str(0, f)), 0);
+ BOOST_CHECK_CLOSE(n3, boost::lexical_cast<target_type>(Real(n3).str(0, f)), 0);
+ BOOST_CHECK_CLOSE(n4, boost::lexical_cast<target_type>(Real(n4).str(0, f)), 0);
    // Assignment:
    Real r(0);
- BOOST_TEST(r != static_cast<cast_type>(n1));
+ BOOST_CHECK(r != static_cast<cast_type>(n1));
    r = static_cast<simple_cast_type>(n1);
- BOOST_TEST(r == static_cast<cast_type>(n1));
+ BOOST_CHECK_EQUAL(r , static_cast<cast_type>(n1));
    r = static_cast<simple_cast_type>(n2);
- BOOST_TEST(r == static_cast<cast_type>(n2));
+ BOOST_CHECK_EQUAL(r , static_cast<cast_type>(n2));
    r = static_cast<simple_cast_type>(n3);
- BOOST_TEST(r == static_cast<cast_type>(n3));
+ BOOST_CHECK_EQUAL(r , static_cast<cast_type>(n3));
    r = static_cast<simple_cast_type>(n4);
- BOOST_TEST(r == static_cast<cast_type>(n4));
+ BOOST_CHECK_EQUAL(r , static_cast<cast_type>(n4));
    // Addition:
    r = static_cast<simple_cast_type>(n2);
- BOOST_TEST(r + static_cast<simple_cast_type>(n4) == static_cast<cast_type>(n2 + n4));
- BOOST_TEST(Real(r + static_cast<simple_cast_type>(n4)) == static_cast<cast_type>(n2 + n4));
+ BOOST_CHECK_EQUAL(r + static_cast<simple_cast_type>(n4) , static_cast<cast_type>(n2 + n4));
+ BOOST_CHECK_EQUAL(Real(r + static_cast<simple_cast_type>(n4)) , static_cast<cast_type>(n2 + n4));
    r += static_cast<simple_cast_type>(n4);
- BOOST_TEST(r == static_cast<cast_type>(n2 + n4));
+ BOOST_CHECK_EQUAL(r , static_cast<cast_type>(n2 + n4));
    // subtraction:
    r = static_cast<simple_cast_type>(n4);
- BOOST_TEST(r - static_cast<simple_cast_type>(n5) == static_cast<cast_type>(n4 - n5));
- BOOST_TEST(Real(r - static_cast<simple_cast_type>(n5)) == static_cast<cast_type>(n4 - n5));
+ BOOST_CHECK_EQUAL(r - static_cast<simple_cast_type>(n5) , static_cast<cast_type>(n4 - n5));
+ BOOST_CHECK_EQUAL(Real(r - static_cast<simple_cast_type>(n5)) , static_cast<cast_type>(n4 - n5));
    r -= static_cast<simple_cast_type>(n5);
- BOOST_TEST(r == static_cast<cast_type>(n4 - n5));
+ BOOST_CHECK_EQUAL(r , static_cast<cast_type>(n4 - n5));
    // Multiplication:
    r = static_cast<simple_cast_type>(n2);
- BOOST_TEST(r * static_cast<simple_cast_type>(n4) == static_cast<cast_type>(n2 * n4));
- BOOST_TEST(Real(r * static_cast<simple_cast_type>(n4)) == static_cast<cast_type>(n2 * n4));
+ BOOST_CHECK_EQUAL(r * static_cast<simple_cast_type>(n4) , static_cast<cast_type>(n2 * n4));
+ BOOST_CHECK_EQUAL(Real(r * static_cast<simple_cast_type>(n4)) , static_cast<cast_type>(n2 * n4));
    r *= static_cast<simple_cast_type>(n4);
- BOOST_TEST(r == static_cast<cast_type>(n2 * n4));
+ BOOST_CHECK_EQUAL(r , static_cast<cast_type>(n2 * n4));
    // Division:
    r = static_cast<simple_cast_type>(n1);
- BOOST_TEST(r / static_cast<simple_cast_type>(n5) == static_cast<cast_type>(n1 / n5));
- BOOST_TEST(Real(r / static_cast<simple_cast_type>(n5)) == static_cast<cast_type>(n1 / n5));
+ BOOST_CHECK_EQUAL(r / static_cast<simple_cast_type>(n5) , static_cast<cast_type>(n1 / n5));
+ BOOST_CHECK_EQUAL(Real(r / static_cast<simple_cast_type>(n5)) , static_cast<cast_type>(n1 / n5));
    r /= static_cast<simple_cast_type>(n5);
- BOOST_TEST(r == static_cast<cast_type>(n1 / n5));
+ BOOST_CHECK_EQUAL(r , static_cast<cast_type>(n1 / n5));
    //
    // Extra cases for full coverage:
    //
    r = Real(n4) + static_cast<simple_cast_type>(n5);
- BOOST_TEST(r == static_cast<cast_type>(n4 + n5));
+ BOOST_CHECK_EQUAL(r , static_cast<cast_type>(n4 + n5));
    r = static_cast<simple_cast_type>(n4) + Real(n5);
- BOOST_TEST(r == static_cast<cast_type>(n4 + n5));
+ BOOST_CHECK_EQUAL(r , static_cast<cast_type>(n4 + n5));
    r = Real(n4) - static_cast<simple_cast_type>(n5);
- BOOST_TEST(r == static_cast<cast_type>(n4 - n5));
+ BOOST_CHECK_EQUAL(r , static_cast<cast_type>(n4 - n5));
    r = static_cast<simple_cast_type>(n4) - Real(n5);
- BOOST_TEST(r == static_cast<cast_type>(n4 - n5));
+ BOOST_CHECK_EQUAL(r , static_cast<cast_type>(n4 - n5));
    r = static_cast<simple_cast_type>(n4) * Real(n5);
- BOOST_TEST(r == static_cast<cast_type>(n4 * n5));
+ BOOST_CHECK_EQUAL(r , static_cast<cast_type>(n4 * n5));
    r = static_cast<cast_type>(4 * n4) / Real(4);
- BOOST_TEST(r == static_cast<cast_type>(n4));
+ BOOST_CHECK_EQUAL(r , static_cast<cast_type>(n4));
 
    Real a, b, c;
    a = 20;
    b = 30;
    c = -a + b;
- BOOST_TEST(c == 10);
+ BOOST_CHECK_EQUAL(c , 10);
    c = b + -a;
- BOOST_TEST(c == 10);
+ BOOST_CHECK_EQUAL(c , 10);
    n4 = 30;
    c = -a + static_cast<cast_type>(n4);
- BOOST_TEST(c == 10);
+ BOOST_CHECK_EQUAL(c , 10);
    c = static_cast<cast_type>(n4) + -a;
- BOOST_TEST(c == 10);
+ BOOST_CHECK_EQUAL(c , 10);
    c = -a + -b;
- BOOST_TEST(c == -50);
+ BOOST_CHECK_EQUAL(c , -50);
    n4 = 4;
    c = -(a + b) + static_cast<cast_type>(n4);
- BOOST_TEST(c == -50+4);
+ BOOST_CHECK_EQUAL(c , -50+4);
    n4 = 50;
    c = (a + b) - static_cast<cast_type>(n4);
- BOOST_TEST(c == 0);
+ BOOST_CHECK_EQUAL(c , 0);
    c = (a + b) - static_cast<cast_type>(n4);
- BOOST_TEST(c == 0);
+ BOOST_CHECK_EQUAL(c , 0);
    c = a - -(b + static_cast<cast_type>(n4));
- BOOST_TEST(c == 20 - -(30 + 50));
+ BOOST_CHECK_EQUAL(c , 20 - -(30 + 50));
    c = -(b + static_cast<cast_type>(n4)) - a;
- BOOST_TEST(c == -(30 + 50) - 20);
+ BOOST_CHECK_EQUAL(c , -(30 + 50) - 20);
    c = a - -b;
- BOOST_TEST(c == 50);
+ BOOST_CHECK_EQUAL(c , 50);
    c = -a - b;
- BOOST_TEST(c == -50);
+ BOOST_CHECK_EQUAL(c , -50);
    c = -a - static_cast<cast_type>(n4);
- BOOST_TEST(c == -20 - 50);
+ BOOST_CHECK_EQUAL(c , -20 - 50);
    c = static_cast<cast_type>(n4) - -a;
- BOOST_TEST(c == 50 + 20);
+ BOOST_CHECK_EQUAL(c , 50 + 20);
    c = -(a + b) - Real(n4);
- BOOST_TEST(c == -(20 + 30) - 50);
+ BOOST_CHECK_EQUAL(c , -(20 + 30) - 50);
    c = static_cast<cast_type>(n4) - (a + b);
- BOOST_TEST(c == 0);
+ BOOST_CHECK_EQUAL(c , 0);
    c = (a + b) * static_cast<cast_type>(n4);
- BOOST_TEST(c == 50 * 50);
+ BOOST_CHECK_EQUAL(c , 50 * 50);
    c = static_cast<cast_type>(n4) * (a + b);
- BOOST_TEST(c == 50 * 50);
+ BOOST_CHECK_EQUAL(c , 50 * 50);
    c = a * -(b + static_cast<cast_type>(n4));
- BOOST_TEST(c == 20 * -(30 + 50));
+ BOOST_CHECK_EQUAL(c , 20 * -(30 + 50));
    c = -(b + static_cast<cast_type>(n4)) * a;
- BOOST_TEST(c == 20 * -(30 + 50));
+ BOOST_CHECK_EQUAL(c , 20 * -(30 + 50));
    c = a * -b;
- BOOST_TEST(c == 20 * -30);
+ BOOST_CHECK_EQUAL(c , 20 * -30);
    c = -a * b;
- BOOST_TEST(c == 20 * -30);
+ BOOST_CHECK_EQUAL(c , 20 * -30);
    c = -a * static_cast<cast_type>(n4);
- BOOST_TEST(c == -20 * 50);
+ BOOST_CHECK_EQUAL(c , -20 * 50);
    c = static_cast<cast_type>(n4) * -a;
- BOOST_TEST(c == -20 * 50);
+ BOOST_CHECK_EQUAL(c , -20 * 50);
    c = -(a + b) + a;
- BOOST_TEST(-50 + 20);
+ BOOST_CHECK(-50 + 20);
    c = static_cast<cast_type>(n4) - (a + b);
- BOOST_TEST(c == 0);
+ BOOST_CHECK_EQUAL(c , 0);
    Real d = 10;
    c = (a + b) / d;
- BOOST_TEST(c == 5);
+ BOOST_CHECK_EQUAL(c , 5);
    c = (a + b) / (d + 0);
- BOOST_TEST(c == 5);
+ BOOST_CHECK_EQUAL(c , 5);
    c = (a + b) / static_cast<cast_type>(n4);
- BOOST_TEST(c == 1);
+ BOOST_CHECK_EQUAL(c , 1);
    c = static_cast<cast_type>(n4) / (a + b);
- BOOST_TEST(c == 1);
+ BOOST_CHECK_EQUAL(c , 1);
    d = 50;
    c = d / -(a + b);
- BOOST_TEST(c == -1);
+ BOOST_CHECK_EQUAL(c , -1);
    c = -(a + b) / d;
- BOOST_TEST(c == -1);
+ BOOST_CHECK_EQUAL(c , -1);
    d = 2;
    c = a / -d;
- BOOST_TEST(c == 20 / -2);
+ BOOST_CHECK_EQUAL(c , 20 / -2);
    c = -a / d;
- BOOST_TEST(c == 20 / -2);
+ BOOST_CHECK_EQUAL(c , 20 / -2);
    d = 50;
    c = -d / static_cast<cast_type>(n4);
- BOOST_TEST(c == -1);
+ BOOST_CHECK_EQUAL(c , -1);
    c = static_cast<cast_type>(n4) / -d;
- BOOST_TEST(c == -1);
+ BOOST_CHECK_EQUAL(c , -1);
    c = static_cast<cast_type>(n4) + a;
- BOOST_TEST(c == 70);
+ BOOST_CHECK_EQUAL(c , 70);
    c = static_cast<cast_type>(n4) - a;
- BOOST_TEST(c == 30);
+ BOOST_CHECK_EQUAL(c , 30);
    c = static_cast<cast_type>(n4) * a;
- BOOST_TEST(c == 50 * 20);
+ BOOST_CHECK_EQUAL(c , 50 * 20);
 
    n1 = -2;
    n2 = -3;
@@ -1089,71 +1060,71 @@
    b = static_cast<cast_type>(n2);
    c = static_cast<cast_type>(n3);
    d = a + b * c;
- BOOST_TEST(d == -2 + -3 * -4);
+ BOOST_CHECK_EQUAL(d , -2 + -3 * -4);
    d = static_cast<cast_type>(n1) + b * c;
- BOOST_TEST(d == -2 + -3 * -4);
+ BOOST_CHECK_EQUAL(d , -2 + -3 * -4);
    d = a + static_cast<cast_type>(n2) * c;
- BOOST_TEST(d == -2 + -3 * -4);
+ BOOST_CHECK_EQUAL(d , -2 + -3 * -4);
    d = a + b * static_cast<cast_type>(n3);
- BOOST_TEST(d == -2 + -3 * -4);
+ BOOST_CHECK_EQUAL(d , -2 + -3 * -4);
    d = static_cast<cast_type>(n1) + static_cast<cast_type>(n2) * c;
- BOOST_TEST(d == -2 + -3 * -4);
+ BOOST_CHECK_EQUAL(d , -2 + -3 * -4);
    d = static_cast<cast_type>(n1) + b * static_cast<cast_type>(n3);
- BOOST_TEST(d == -2 + -3 * -4);
+ BOOST_CHECK_EQUAL(d , -2 + -3 * -4);
    a += static_cast<cast_type>(n2) * c;
- BOOST_TEST(a == -2 + -3 * -4);
+ BOOST_CHECK_EQUAL(a , -2 + -3 * -4);
    a = static_cast<cast_type>(n1);
    a += b * static_cast<cast_type>(n3);
- BOOST_TEST(a == -2 + -3 * -4);
+ BOOST_CHECK_EQUAL(a , -2 + -3 * -4);
    a = static_cast<cast_type>(n1);
 
    d = b * c + a;
- BOOST_TEST(d == -2 + -3 * -4);
+ BOOST_CHECK_EQUAL(d , -2 + -3 * -4);
    d = b * c + static_cast<cast_type>(n1);
- BOOST_TEST(d == -2 + -3 * -4);
+ BOOST_CHECK_EQUAL(d , -2 + -3 * -4);
    d = static_cast<cast_type>(n2) * c + a;
- BOOST_TEST(d == -2 + -3 * -4);
+ BOOST_CHECK_EQUAL(d , -2 + -3 * -4);
    d = b * static_cast<cast_type>(n3) + a;
- BOOST_TEST(d == -2 + -3 * -4);
+ BOOST_CHECK_EQUAL(d , -2 + -3 * -4);
    d = static_cast<cast_type>(n2) * c + static_cast<cast_type>(n1);
- BOOST_TEST(d == -2 + -3 * -4);
+ BOOST_CHECK_EQUAL(d , -2 + -3 * -4);
    d = b * static_cast<cast_type>(n3) + static_cast<cast_type>(n1);
- BOOST_TEST(d == -2 + -3 * -4);
+ BOOST_CHECK_EQUAL(d , -2 + -3 * -4);
 
    a = -20;
    d = a - b * c;
- BOOST_TEST(d == -20 - -3 * -4);
+ BOOST_CHECK_EQUAL(d , -20 - -3 * -4);
    n1 = -20;
    d = static_cast<cast_type>(n1) - b * c;
- BOOST_TEST(d == -20 - -3 * -4);
+ BOOST_CHECK_EQUAL(d , -20 - -3 * -4);
    d = a - static_cast<cast_type>(n2) * c;
- BOOST_TEST(d == -20 - -3 * -4);
+ BOOST_CHECK_EQUAL(d , -20 - -3 * -4);
    d = a - b * static_cast<cast_type>(n3);
- BOOST_TEST(d == -20 - -3 * -4);
+ BOOST_CHECK_EQUAL(d , -20 - -3 * -4);
    d = static_cast<cast_type>(n1) - static_cast<cast_type>(n2) * c;
- BOOST_TEST(d == -20 - -3 * -4);
+ BOOST_CHECK_EQUAL(d , -20 - -3 * -4);
    d = static_cast<cast_type>(n1) - b * static_cast<cast_type>(n3);
- BOOST_TEST(d == -20 - -3 * -4);
+ BOOST_CHECK_EQUAL(d , -20 - -3 * -4);
    a -= static_cast<cast_type>(n2) * c;
- BOOST_TEST(a == -20 - -3 * -4);
+ BOOST_CHECK_EQUAL(a , -20 - -3 * -4);
    a = static_cast<cast_type>(n1);
    a -= b * static_cast<cast_type>(n3);
- BOOST_TEST(a == -20 - -3 * -4);
+ BOOST_CHECK_EQUAL(a , -20 - -3 * -4);
 
    a = -2;
    d = b * c - a;
- BOOST_TEST(d == -3 * -4 - -2);
+ BOOST_CHECK_EQUAL(d , -3 * -4 - -2);
    n1 = -2;
    d = b * c - static_cast<cast_type>(n1);
- BOOST_TEST(d == -3 * -4 - -2);
+ BOOST_CHECK_EQUAL(d , -3 * -4 - -2);
    d = static_cast<cast_type>(n2) * c - a;
- BOOST_TEST(d == -3 * -4 - -2);
+ BOOST_CHECK_EQUAL(d , -3 * -4 - -2);
    d = b * static_cast<cast_type>(n3) - a;
- BOOST_TEST(d == -3 * -4 - -2);
+ BOOST_CHECK_EQUAL(d , -3 * -4 - -2);
    d = static_cast<cast_type>(n2) * c - static_cast<cast_type>(n1);
- BOOST_TEST(d == -3 * -4 - -2);
+ BOOST_CHECK_EQUAL(d , -3 * -4 - -2);
    d = b * static_cast<cast_type>(n3) - static_cast<cast_type>(n1);
- BOOST_TEST(d == -3 * -4 - -2);
+ BOOST_CHECK_EQUAL(d , -3 * -4 - -2);
 }
 
 template <class Real, class Num>
@@ -1200,24 +1171,24 @@
    test_comparisons<Real>(n3, n3, boost::is_convertible<Num, Real>());
 
    // Default construct:
- BOOST_TEST(Real(n1) == static_cast<cast_type>(n1));
- BOOST_TEST(Real(n2) == static_cast<cast_type>(n2));
- BOOST_TEST(Real(n3) == static_cast<cast_type>(n3));
- BOOST_TEST(Real(n4) == static_cast<cast_type>(n4));
- BOOST_TEST(Real(n1).template convert_to<Num>() == n1);
- BOOST_TEST(Real(n2).template convert_to<Num>() == n2);
- BOOST_TEST(Real(n3).template convert_to<Num>() == n3);
- BOOST_TEST(Real(n4).template convert_to<Num>() == n4);
+ BOOST_CHECK_EQUAL(Real(n1) , static_cast<cast_type>(n1));
+ BOOST_CHECK_EQUAL(Real(n2) , static_cast<cast_type>(n2));
+ BOOST_CHECK_EQUAL(Real(n3) , static_cast<cast_type>(n3));
+ BOOST_CHECK_EQUAL(Real(n4) , static_cast<cast_type>(n4));
+ BOOST_CHECK_EQUAL(Real(n1).template convert_to<Num>() , n1);
+ BOOST_CHECK_EQUAL(Real(n2).template convert_to<Num>() , n2);
+ BOOST_CHECK_EQUAL(Real(n3).template convert_to<Num>() , n3);
+ BOOST_CHECK_EQUAL(Real(n4).template convert_to<Num>() , n4);
 #ifndef BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
- BOOST_TEST(static_cast<Num>(Real(n1)) == n1);
- BOOST_TEST(static_cast<Num>(Real(n2)) == n2);
- BOOST_TEST(static_cast<Num>(Real(n3)) == n3);
- BOOST_TEST(static_cast<Num>(Real(n4)) == n4);
-#endif
- BOOST_TEST(static_cast<cast_type>(n1) == Real(n1));
- BOOST_TEST(static_cast<cast_type>(n2) == Real(n2));
- BOOST_TEST(static_cast<cast_type>(n3) == Real(n3));
- BOOST_TEST(static_cast<cast_type>(n4) == Real(n4));
+ BOOST_CHECK_EQUAL(static_cast<Num>(Real(n1)) , n1);
+ BOOST_CHECK_EQUAL(static_cast<Num>(Real(n2)) , n2);
+ BOOST_CHECK_EQUAL(static_cast<Num>(Real(n3)) , n3);
+ BOOST_CHECK_EQUAL(static_cast<Num>(Real(n4)) , n4);
+#endif
+ BOOST_CHECK_EQUAL(static_cast<cast_type>(n1) , Real(n1));
+ BOOST_CHECK_EQUAL(static_cast<cast_type>(n2) , Real(n2));
+ BOOST_CHECK_EQUAL(static_cast<cast_type>(n3) , Real(n3));
+ BOOST_CHECK_EQUAL(static_cast<cast_type>(n4) , Real(n4));
 #if defined(TEST_MPFR) || defined(TEST_MPFR_50)
    Num tol = 10 * std::numeric_limits<Num>::epsilon();
 #else
@@ -1226,57 +1197,57 @@
    std::ios_base::fmtflags f = boost::is_floating_point<Num>::value ? std::ios_base::scientific : std::ios_base::fmtflags(0);
    if(std::numeric_limits<target_type>::digits <= std::numeric_limits<Real>::digits)
    {
- BOOST_TEST_CLOSE(n1, boost::lexical_cast<target_type>(Real(n1).str(0, f)), tol);
+ BOOST_CHECK_CLOSE(n1, boost::lexical_cast<target_type>(Real(n1).str(0, f)), tol);
    }
- BOOST_TEST_CLOSE(n2, boost::lexical_cast<target_type>(Real(n2).str(0, f)), 0);
- BOOST_TEST_CLOSE(n3, boost::lexical_cast<target_type>(Real(n3).str(0, f)), 0);
- BOOST_TEST_CLOSE(n4, boost::lexical_cast<target_type>(Real(n4).str(0, f)), 0);
+ BOOST_CHECK_CLOSE(n2, boost::lexical_cast<target_type>(Real(n2).str(0, f)), 0);
+ BOOST_CHECK_CLOSE(n3, boost::lexical_cast<target_type>(Real(n3).str(0, f)), 0);
+ BOOST_CHECK_CLOSE(n4, boost::lexical_cast<target_type>(Real(n4).str(0, f)), 0);
    // Assignment:
    Real r(0);
- BOOST_TEST(r != static_cast<cast_type>(n1));
+ BOOST_CHECK(r != static_cast<cast_type>(n1));
    r = static_cast<simple_cast_type>(n1);
- BOOST_TEST(r == static_cast<cast_type>(n1));
+ BOOST_CHECK_EQUAL(r , static_cast<cast_type>(n1));
    r = static_cast<simple_cast_type>(n2);
- BOOST_TEST(r == static_cast<cast_type>(n2));
+ BOOST_CHECK_EQUAL(r , static_cast<cast_type>(n2));
    r = static_cast<simple_cast_type>(n3);
- BOOST_TEST(r == static_cast<cast_type>(n3));
+ BOOST_CHECK_EQUAL(r , static_cast<cast_type>(n3));
    r = static_cast<simple_cast_type>(n4);
- BOOST_TEST(r == static_cast<cast_type>(n4));
+ BOOST_CHECK_EQUAL(r , static_cast<cast_type>(n4));
    // Addition:
    r = static_cast<simple_cast_type>(n2);
- BOOST_TEST(r + static_cast<simple_cast_type>(n4) == static_cast<cast_type>(n2 + n4));
- BOOST_TEST(Real(r + static_cast<simple_cast_type>(n4)) == static_cast<cast_type>(n2 + n4));
+ BOOST_CHECK_EQUAL(r + static_cast<simple_cast_type>(n4) , static_cast<cast_type>(n2 + n4));
+ BOOST_CHECK_EQUAL(Real(r + static_cast<simple_cast_type>(n4)) , static_cast<cast_type>(n2 + n4));
    r += static_cast<simple_cast_type>(n4);
- BOOST_TEST(r == static_cast<cast_type>(n2 + n4));
+ BOOST_CHECK_EQUAL(r , static_cast<cast_type>(n2 + n4));
    // subtraction:
    r = static_cast<simple_cast_type>(n4);
- BOOST_TEST(r - static_cast<simple_cast_type>(n5) == static_cast<cast_type>(n4 - n5));
- BOOST_TEST(Real(r - static_cast<simple_cast_type>(n5)) == static_cast<cast_type>(n4 - n5));
+ BOOST_CHECK_EQUAL(r - static_cast<simple_cast_type>(n5) , static_cast<cast_type>(n4 - n5));
+ BOOST_CHECK_EQUAL(Real(r - static_cast<simple_cast_type>(n5)) , static_cast<cast_type>(n4 - n5));
    r -= static_cast<simple_cast_type>(n5);
- BOOST_TEST(r == static_cast<cast_type>(n4 - n5));
+ BOOST_CHECK_EQUAL(r , static_cast<cast_type>(n4 - n5));
    // Multiplication:
    r = static_cast<simple_cast_type>(n2);
- BOOST_TEST(r * static_cast<simple_cast_type>(n4) == static_cast<cast_type>(n2 * n4));
- BOOST_TEST(Real(r * static_cast<simple_cast_type>(n4)) == static_cast<cast_type>(n2 * n4));
+ BOOST_CHECK_EQUAL(r * static_cast<simple_cast_type>(n4) , static_cast<cast_type>(n2 * n4));
+ BOOST_CHECK_EQUAL(Real(r * static_cast<simple_cast_type>(n4)) , static_cast<cast_type>(n2 * n4));
    r *= static_cast<simple_cast_type>(n4);
- BOOST_TEST(r == static_cast<cast_type>(n2 * n4));
+ BOOST_CHECK_EQUAL(r , static_cast<cast_type>(n2 * n4));
    // Division:
    r = static_cast<simple_cast_type>(n1);
- BOOST_TEST(r / static_cast<simple_cast_type>(n5) == static_cast<cast_type>(n1 / n5));
- BOOST_TEST(Real(r / static_cast<simple_cast_type>(n5)) == static_cast<cast_type>(n1 / n5));
+ BOOST_CHECK_EQUAL(r / static_cast<simple_cast_type>(n5) , static_cast<cast_type>(n1 / n5));
+ BOOST_CHECK_EQUAL(Real(r / static_cast<simple_cast_type>(n5)) , static_cast<cast_type>(n1 / n5));
    r /= static_cast<simple_cast_type>(n5);
- BOOST_TEST(r == static_cast<cast_type>(n1 / n5));
+ BOOST_CHECK_EQUAL(r , static_cast<cast_type>(n1 / n5));
    //
    // special cases for full coverage:
    //
    r = static_cast<simple_cast_type>(n5) + Real(n4);
- BOOST_TEST(r == static_cast<cast_type>(n4 + n5));
+ BOOST_CHECK_EQUAL(r , static_cast<cast_type>(n4 + n5));
    r = static_cast<simple_cast_type>(n4) - Real(n5);
- BOOST_TEST(r == static_cast<cast_type>(n4 - n5));
+ BOOST_CHECK_EQUAL(r , static_cast<cast_type>(n4 - n5));
    r = static_cast<simple_cast_type>(n4) * Real(n5);
- BOOST_TEST(r == static_cast<cast_type>(n4 * n5));
+ BOOST_CHECK_EQUAL(r , static_cast<cast_type>(n4 * n5));
    r = static_cast<cast_type>(4 * n4) / Real(4);
- BOOST_TEST(r == static_cast<cast_type>(n4));
+ BOOST_CHECK_EQUAL(r , static_cast<cast_type>(n4));
 
    typedef boost::mpl::bool_<
       (!std::numeric_limits<Num>::is_specialized || std::numeric_limits<Num>::is_signed)
@@ -1289,71 +1260,71 @@
    n3 = 4;
    Real a(n1), b(n2), c(n3), d;
    d = a + b * c;
- BOOST_TEST(d == 2 + 3 * 4);
+ BOOST_CHECK_EQUAL(d , 2 + 3 * 4);
    d = static_cast<cast_type>(n1) + b * c;
- BOOST_TEST(d == 2 + 3 * 4);
+ BOOST_CHECK_EQUAL(d , 2 + 3 * 4);
    d = a + static_cast<cast_type>(n2) * c;
- BOOST_TEST(d == 2 + 3 * 4);
+ BOOST_CHECK_EQUAL(d , 2 + 3 * 4);
    d = a + b * static_cast<cast_type>(n3);
- BOOST_TEST(d == 2 + 3 * 4);
+ BOOST_CHECK_EQUAL(d , 2 + 3 * 4);
    d = static_cast<cast_type>(n1) + static_cast<cast_type>(n2) * c;
- BOOST_TEST(d == 2 + 3 * 4);
+ BOOST_CHECK_EQUAL(d , 2 + 3 * 4);
    d = static_cast<cast_type>(n1) + b * static_cast<cast_type>(n3);
- BOOST_TEST(d == 2 + 3 * 4);
+ BOOST_CHECK_EQUAL(d , 2 + 3 * 4);
    a += static_cast<cast_type>(n2) * c;
- BOOST_TEST(a == 2 + 3 * 4);
+ BOOST_CHECK_EQUAL(a , 2 + 3 * 4);
    a = static_cast<cast_type>(n1);
    a += b * static_cast<cast_type>(n3);
- BOOST_TEST(a == 2 + 3 * 4);
+ BOOST_CHECK_EQUAL(a , 2 + 3 * 4);
    a = static_cast<cast_type>(n1);
 
    d = b * c + a;
- BOOST_TEST(d == 2 + 3 * 4);
+ BOOST_CHECK_EQUAL(d , 2 + 3 * 4);
    d = b * c + static_cast<cast_type>(n1);
- BOOST_TEST(d == 2 + 3 * 4);
+ BOOST_CHECK_EQUAL(d , 2 + 3 * 4);
    d = static_cast<cast_type>(n2) * c + a;
- BOOST_TEST(d == 2 + 3 * 4);
+ BOOST_CHECK_EQUAL(d , 2 + 3 * 4);
    d = b * static_cast<cast_type>(n3) + a;
- BOOST_TEST(d == 2 + 3 * 4);
+ BOOST_CHECK_EQUAL(d , 2 + 3 * 4);
    d = static_cast<cast_type>(n2) * c + static_cast<cast_type>(n1);
- BOOST_TEST(d == 2 + 3 * 4);
+ BOOST_CHECK_EQUAL(d , 2 + 3 * 4);
    d = b * static_cast<cast_type>(n3) + static_cast<cast_type>(n1);
- BOOST_TEST(d == 2 + 3 * 4);
+ BOOST_CHECK_EQUAL(d , 2 + 3 * 4);
 
    a = 20;
    d = a - b * c;
- BOOST_TEST(d == 20 - 3 * 4);
+ BOOST_CHECK_EQUAL(d , 20 - 3 * 4);
    n1 = 20;
    d = static_cast<cast_type>(n1) - b * c;
- BOOST_TEST(d == 20 - 3 * 4);
+ BOOST_CHECK_EQUAL(d , 20 - 3 * 4);
    d = a - static_cast<cast_type>(n2) * c;
- BOOST_TEST(d == 20 - 3 * 4);
+ BOOST_CHECK_EQUAL(d , 20 - 3 * 4);
    d = a - b * static_cast<cast_type>(n3);
- BOOST_TEST(d == 20 - 3 * 4);
+ BOOST_CHECK_EQUAL(d , 20 - 3 * 4);
    d = static_cast<cast_type>(n1) - static_cast<cast_type>(n2) * c;
- BOOST_TEST(d == 20 - 3 * 4);
+ BOOST_CHECK_EQUAL(d , 20 - 3 * 4);
    d = static_cast<cast_type>(n1) - b * static_cast<cast_type>(n3);
- BOOST_TEST(d == 20 - 3 * 4);
+ BOOST_CHECK_EQUAL(d , 20 - 3 * 4);
    a -= static_cast<cast_type>(n2) * c;
- BOOST_TEST(a == 20 - 3 * 4);
+ BOOST_CHECK_EQUAL(a , 20 - 3 * 4);
    a = static_cast<cast_type>(n1);
    a -= b * static_cast<cast_type>(n3);
- BOOST_TEST(a == 20 - 3 * 4);
+ BOOST_CHECK_EQUAL(a , 20 - 3 * 4);
 
    a = 2;
    d = b * c - a;
- BOOST_TEST(d == 3 * 4 - 2);
+ BOOST_CHECK_EQUAL(d , 3 * 4 - 2);
    n1 = 2;
    d = b * c - static_cast<cast_type>(n1);
- BOOST_TEST(d == 3 * 4 - 2);
+ BOOST_CHECK_EQUAL(d , 3 * 4 - 2);
    d = static_cast<cast_type>(n2) * c - a;
- BOOST_TEST(d == 3 * 4 - 2);
+ BOOST_CHECK_EQUAL(d , 3 * 4 - 2);
    d = b * static_cast<cast_type>(n3) - a;
- BOOST_TEST(d == 3 * 4 - a);
+ BOOST_CHECK_EQUAL(d , 3 * 4 - a);
    d = static_cast<cast_type>(n2) * c - static_cast<cast_type>(n1);
- BOOST_TEST(d == 3 * 4 - 2);
+ BOOST_CHECK_EQUAL(d , 3 * 4 - 2);
    d = b * static_cast<cast_type>(n3) - static_cast<cast_type>(n1);
- BOOST_TEST(d == 3 * 4 - 2);
+ BOOST_CHECK_EQUAL(d , 3 * 4 - 2);
 }
 
 template <class Real>
@@ -1364,23 +1335,23 @@
    //
    Real a = 20;
    Real b = 30;
- BOOST_TEST(a.sign() > 0);
- BOOST_TEST(!a.is_zero());
+ BOOST_CHECK(a.sign() > 0);
+ BOOST_CHECK(!a.is_zero());
    if(std::numeric_limits<Real>::is_signed)
    {
       a = -20;
- BOOST_TEST(a.sign() < 0);
- BOOST_TEST(!a.is_zero());
+ BOOST_CHECK(a.sign() < 0);
+ BOOST_CHECK(!a.is_zero());
    }
    a = 0;
- BOOST_TEST(a.sign() == 0);
- BOOST_TEST(a.is_zero());
+ BOOST_CHECK_EQUAL(a.sign() , 0);
+ BOOST_CHECK(a.is_zero());
 
    a = 20;
    b = 30;
    a.swap(b);
- BOOST_TEST(a == 30);
- BOOST_TEST(b == 20);
+ BOOST_CHECK_EQUAL(a , 30);
+ BOOST_CHECK_EQUAL(b , 20);
 }
 
 template <class Real>
@@ -1396,38 +1367,38 @@
    Real c(500);
    Real d(1024);
    Real ac;
- BOOST_TEST(-a == -8);
+ BOOST_CHECK_EQUAL(-a , -8);
    ac = a;
    ac = ac - b;
- BOOST_TEST(ac == 8 - 64);
+ BOOST_CHECK_EQUAL(ac , 8 - 64);
    ac = a;
    ac -= a + b;
- BOOST_TEST(ac == -64);
+ BOOST_CHECK_EQUAL(ac , -64);
    ac = a;
    ac -= b - a;
- BOOST_TEST(ac == 16 - 64);
+ BOOST_CHECK_EQUAL(ac , 16 - 64);
    ac = -a;
- BOOST_TEST(ac == -8);
+ BOOST_CHECK_EQUAL(ac , -8);
    ac = a;
    ac -= -a;
- BOOST_TEST(ac == 16);
+ BOOST_CHECK_EQUAL(ac , 16);
    ac = a;
    ac += -a;
- BOOST_TEST(ac == 0);
+ BOOST_CHECK_EQUAL(ac , 0);
    ac = b;
    ac /= -a;
- BOOST_TEST(ac == -8);
+ BOOST_CHECK_EQUAL(ac , -8);
    ac = a;
    ac *= -a;
- BOOST_TEST(ac == -64);
+ BOOST_CHECK_EQUAL(ac , -64);
    ac = a + -b;
- BOOST_TEST(ac == 8 - 64);
+ BOOST_CHECK_EQUAL(ac , 8 - 64);
    ac = -a + b;
- BOOST_TEST(ac == -8+64);
+ BOOST_CHECK_EQUAL(ac , -8+64);
    ac = -a + -b;
- BOOST_TEST(ac == -72);
+ BOOST_CHECK_EQUAL(ac , -72);
    ac = a + - + -b; // lots of unary operators!!
- BOOST_TEST(ac == 72);
+ BOOST_CHECK_EQUAL(ac , 72);
    test_conditional(Real(-a), -a);
 }
 template <class Real>
@@ -1478,194 +1449,194 @@
    Real b(64);
    Real c(500);
    Real d(1024);
- BOOST_TEST(a + b == 72);
+ BOOST_CHECK_EQUAL(a + b , 72);
    a += b;
- BOOST_TEST(a == 72);
- BOOST_TEST(a - b == 8);
+ BOOST_CHECK_EQUAL(a , 72);
+ BOOST_CHECK_EQUAL(a - b , 8);
    a -= b;
- BOOST_TEST(a == 8);
- BOOST_TEST(a * b == 8*64L);
+ BOOST_CHECK_EQUAL(a , 8);
+ BOOST_CHECK_EQUAL(a * b , 8*64L);
    a *= b;
- BOOST_TEST(a == 8*64L);
- BOOST_TEST(a / b == 8);
+ BOOST_CHECK_EQUAL(a , 8*64L);
+ BOOST_CHECK_EQUAL(a / b , 8);
    a /= b;
- BOOST_TEST(a == 8);
+ BOOST_CHECK_EQUAL(a , 8);
    Real ac(a);
- BOOST_TEST(ac == a);
+ BOOST_CHECK_EQUAL(ac , a);
    ac = a * c;
- BOOST_TEST(ac == 8*500L);
+ BOOST_CHECK_EQUAL(ac , 8*500L);
    ac = 8*500L;
    ac = ac + b + c;
- BOOST_TEST(ac == 8*500L+64+500);
+ BOOST_CHECK_EQUAL(ac , 8*500L+64+500);
    ac = a;
    ac = b + c + ac;
- BOOST_TEST(ac == 8+64+500);
+ BOOST_CHECK_EQUAL(ac , 8+64+500);
    ac = ac - b + c;
- BOOST_TEST(ac == 8+64+500-64+500);
+ BOOST_CHECK_EQUAL(ac , 8+64+500-64+500);
    ac = a;
    ac = b + c - ac;
- BOOST_TEST(ac == -8+64+500);
+ BOOST_CHECK_EQUAL(ac , -8+64+500);
    ac = a;
    ac = ac * b;
- BOOST_TEST(ac == 8*64);
+ BOOST_CHECK_EQUAL(ac , 8*64);
    ac = a;
    ac *= b * ac;
- BOOST_TEST(ac == 8*8*64);
+ BOOST_CHECK_EQUAL(ac , 8*8*64);
    ac = b;
    ac = ac / a;
- BOOST_TEST(ac == 64/8);
+ BOOST_CHECK_EQUAL(ac , 64/8);
    ac = b;
    ac /= ac / a;
- BOOST_TEST(ac == 64 / (64/8));
+ BOOST_CHECK_EQUAL(ac , 64 / (64/8));
    ac = a;
    ac = b + ac * a;
- BOOST_TEST(ac == 64 * 2);
+ BOOST_CHECK_EQUAL(ac , 64 * 2);
    ac = a;
    ac = b - ac * a;
- BOOST_TEST(ac == 0);
+ BOOST_CHECK_EQUAL(ac , 0);
    ac = a;
    ac = b * (ac + a);
- BOOST_TEST(ac == 64 * (16));
+ BOOST_CHECK_EQUAL(ac , 64 * (16));
    ac = a;
    ac = b / (ac * 1);
- BOOST_TEST(ac == 64 / 8);
+ BOOST_CHECK_EQUAL(ac , 64 / 8);
    ac = a;
    ac = ac + b;
- BOOST_TEST(ac == 8 + 64);
+ BOOST_CHECK_EQUAL(ac , 8 + 64);
    ac = a;
    ac = a + ac;
- BOOST_TEST(ac == 16);
+ BOOST_CHECK_EQUAL(ac , 16);
    ac = a;
    ac = a - ac;
- BOOST_TEST(ac == 0);
+ BOOST_CHECK_EQUAL(ac , 0);
    ac = a;
    ac += a + b;
- BOOST_TEST(ac == 80);
+ BOOST_CHECK_EQUAL(ac , 80);
    ac = a;
    ac += b + a;
- BOOST_TEST(ac == 80);
+ BOOST_CHECK_EQUAL(ac , 80);
    ac = +a;
- BOOST_TEST(ac == 8);
+ BOOST_CHECK_EQUAL(ac , 8);
    ac = 8;
    ac = a * ac;
- BOOST_TEST(ac == 8*8);
+ BOOST_CHECK_EQUAL(ac , 8*8);
    ac = a;
    ac = a;
    ac += +a;
- BOOST_TEST(ac == 16);
+ BOOST_CHECK_EQUAL(ac , 16);
    ac = a;
    ac += b - a;
- BOOST_TEST(ac == 8 + 64-8);
+ BOOST_CHECK_EQUAL(ac , 8 + 64-8);
    ac = a;
    ac += b*c;
- BOOST_TEST(ac == 8 + 64 * 500);
+ BOOST_CHECK_EQUAL(ac , 8 + 64 * 500);
    ac = a;
    ac = a;
    ac -= +a;
- BOOST_TEST(ac == 0);
+ BOOST_CHECK_EQUAL(ac , 0);
    ac = a;
    if(std::numeric_limits<Real>::is_signed || is_twos_complement_integer<Real>::value)
    {
       ac = a;
       ac -= c - b;
- BOOST_TEST(ac == 8 - (500-64));
+ BOOST_CHECK_EQUAL(ac , 8 - (500-64));
       ac = a;
       ac -= b*c;
- BOOST_TEST(ac == 8 - 500*64);
+ BOOST_CHECK_EQUAL(ac , 8 - 500*64);
    }
    ac = a;
    ac += ac * b;
- BOOST_TEST(ac == 8 + 8 * 64);
+ BOOST_CHECK_EQUAL(ac , 8 + 8 * 64);
    if(std::numeric_limits<Real>::is_signed || is_twos_complement_integer<Real>::value)
    {
       ac = a;
       ac -= ac * b;
- BOOST_TEST(ac == 8 - 8 * 64);
+ BOOST_CHECK_EQUAL(ac , 8 - 8 * 64);
    }
    ac = a * 8;
    ac *= +a;
- BOOST_TEST(ac == 64 * 8);
+ BOOST_CHECK_EQUAL(ac , 64 * 8);
    ac = a;
    ac *= b * c;
- BOOST_TEST(ac == 8 * 64 * 500);
+ BOOST_CHECK_EQUAL(ac , 8 * 64 * 500);
    ac = a;
    ac *= b / a;
- BOOST_TEST(ac == 8 * 64 / 8);
+ BOOST_CHECK_EQUAL(ac , 8 * 64 / 8);
    ac = a;
    ac *= b + c;
- BOOST_TEST(ac == 8 * (64 + 500));
+ BOOST_CHECK_EQUAL(ac , 8 * (64 + 500));
    ac = b;
    ac /= +a;
- BOOST_TEST(ac == 8);
+ BOOST_CHECK_EQUAL(ac , 8);
    ac = b;
    ac /= b / a;
- BOOST_TEST(ac == 64 / (64/8));
+ BOOST_CHECK_EQUAL(ac , 64 / (64/8));
    ac = b;
    ac /= a + Real(0);
- BOOST_TEST(ac == 8);
+ BOOST_CHECK_EQUAL(ac , 8);
    //
    // simple tests with immediate values, these calls can be optimised in many backends:
    //
    ac = a + b;
- BOOST_TEST(ac == 72);
+ BOOST_CHECK_EQUAL(ac , 72);
    ac = a + +b;
- BOOST_TEST(ac == 72);
+ BOOST_CHECK_EQUAL(ac , 72);
    ac = +a + b;
- BOOST_TEST(ac == 72);
+ BOOST_CHECK_EQUAL(ac , 72);
    ac = +a + +b;
- BOOST_TEST(ac == 72);
+ BOOST_CHECK_EQUAL(ac , 72);
    ac = a;
    ac = b / ac;
- BOOST_TEST(ac == b / a);
+ BOOST_CHECK_EQUAL(ac , b / a);
    //
    // Comparisons:
    //
- BOOST_TEST((a == b) == false);
- BOOST_TEST((a != b) == true);
- BOOST_TEST((a <= b) == true);
- BOOST_TEST((a < b) == true);
- BOOST_TEST((a >= b) == false);
- BOOST_TEST((a > b) == false);
-
- BOOST_TEST((a+b == b) == false);
- BOOST_TEST((a+b != b) == true);
- BOOST_TEST((a+b >= b) == true);
- BOOST_TEST((a+b > b) == true);
- BOOST_TEST((a+b <= b) == false);
- BOOST_TEST((a+b < b) == false);
-
- BOOST_TEST((a == b+a) == false);
- BOOST_TEST((a != b+a) == true);
- BOOST_TEST((a <= b+a) == true);
- BOOST_TEST((a < b+a) == true);
- BOOST_TEST((a >= b+a) == false);
- BOOST_TEST((a > b+a) == false);
-
- BOOST_TEST((a+b == b+a) == true);
- BOOST_TEST((a+b != b+a) == false);
- BOOST_TEST((a+b <= b+a) == true);
- BOOST_TEST((a+b < b+a) == false);
- BOOST_TEST((a+b >= b+a) == true);
- BOOST_TEST((a+b > b+a) == false);
-
- BOOST_TEST((8 == b+a) == false);
- BOOST_TEST((8 != b+a) == true);
- BOOST_TEST((8 <= b+a) == true);
- BOOST_TEST((8 < b+a) == true);
- BOOST_TEST((8 >= b+a) == false);
- BOOST_TEST((8 > b+a) == false);
- BOOST_TEST((800 == b+a) == false);
- BOOST_TEST((800 != b+a) == true);
- BOOST_TEST((800 >= b+a) == true);
- BOOST_TEST((800 > b+a) == true);
- BOOST_TEST((800 <= b+a) == false);
- BOOST_TEST((800 < b+a) == false);
- BOOST_TEST((72 == b+a) == true);
- BOOST_TEST((72 != b+a) == false);
- BOOST_TEST((72 <= b+a) == true);
- BOOST_TEST((72 < b+a) == false);
- BOOST_TEST((72 >= b+a) == true);
- BOOST_TEST((72 > b+a) == false);
+ BOOST_CHECK_EQUAL((a == b) , false);
+ BOOST_CHECK_EQUAL((a != b) , true);
+ BOOST_CHECK_EQUAL((a <= b) , true);
+ BOOST_CHECK_EQUAL((a < b) , true);
+ BOOST_CHECK_EQUAL((a >= b) , false);
+ BOOST_CHECK_EQUAL((a > b) , false);
+
+ BOOST_CHECK_EQUAL((a+b == b) , false);
+ BOOST_CHECK_EQUAL((a+b != b) , true);
+ BOOST_CHECK_EQUAL((a+b >= b) , true);
+ BOOST_CHECK_EQUAL((a+b > b) , true);
+ BOOST_CHECK_EQUAL((a+b <= b) , false);
+ BOOST_CHECK_EQUAL((a+b < b) , false);
+
+ BOOST_CHECK_EQUAL((a == b+a) , false);
+ BOOST_CHECK_EQUAL((a != b+a) , true);
+ BOOST_CHECK_EQUAL((a <= b+a) , true);
+ BOOST_CHECK_EQUAL((a < b+a) , true);
+ BOOST_CHECK_EQUAL((a >= b+a) , false);
+ BOOST_CHECK_EQUAL((a > b+a) , false);
+
+ BOOST_CHECK_EQUAL((a+b == b+a) , true);
+ BOOST_CHECK_EQUAL((a+b != b+a) , false);
+ BOOST_CHECK_EQUAL((a+b <= b+a) , true);
+ BOOST_CHECK_EQUAL((a+b < b+a) , false);
+ BOOST_CHECK_EQUAL((a+b >= b+a) , true);
+ BOOST_CHECK_EQUAL((a+b > b+a) , false);
+
+ BOOST_CHECK_EQUAL((8 == b+a) , false);
+ BOOST_CHECK_EQUAL((8 != b+a) , true);
+ BOOST_CHECK_EQUAL((8 <= b+a) , true);
+ BOOST_CHECK_EQUAL((8 < b+a) , true);
+ BOOST_CHECK_EQUAL((8 >= b+a) , false);
+ BOOST_CHECK_EQUAL((8 > b+a) , false);
+ BOOST_CHECK_EQUAL((800 == b+a) , false);
+ BOOST_CHECK_EQUAL((800 != b+a) , true);
+ BOOST_CHECK_EQUAL((800 >= b+a) , true);
+ BOOST_CHECK_EQUAL((800 > b+a) , true);
+ BOOST_CHECK_EQUAL((800 <= b+a) , false);
+ BOOST_CHECK_EQUAL((800 < b+a) , false);
+ BOOST_CHECK_EQUAL((72 == b+a) , true);
+ BOOST_CHECK_EQUAL((72 != b+a) , false);
+ BOOST_CHECK_EQUAL((72 <= b+a) , true);
+ BOOST_CHECK_EQUAL((72 < b+a) , false);
+ BOOST_CHECK_EQUAL((72 >= b+a) , true);
+ BOOST_CHECK_EQUAL((72 > b+a) , false);
 
    test_members(a);
    //
@@ -1716,61 +1687,61 @@
    b = 2;
    ss << a;
    ss >> c;
- BOOST_TEST(a == c);
+ BOOST_CHECK_EQUAL(a , c);
    ss.clear();
    ss << a + b;
    ss >> c;
- BOOST_TEST(c == 22);
- BOOST_TEST(c == a + b);
+ BOOST_CHECK_EQUAL(c , 22);
+ BOOST_CHECK_EQUAL(c , a + b);
    //
    // More cases for complete code coverage:
    //
    a = 20;
    b = 30;
    swap(a, b);
- BOOST_TEST(a == 30);
- BOOST_TEST(b == 20);
+ BOOST_CHECK_EQUAL(a , 30);
+ BOOST_CHECK_EQUAL(b , 20);
    a = 20;
    b = 30;
    std::swap(a, b);
- BOOST_TEST(a == 30);
- BOOST_TEST(b == 20);
+ BOOST_CHECK_EQUAL(a , 30);
+ BOOST_CHECK_EQUAL(b , 20);
    a = 20;
    b = 30;
    a = a + b * 2;
- BOOST_TEST(a == 20 + 30 * 2);
+ BOOST_CHECK_EQUAL(a , 20 + 30 * 2);
    a = 100;
    a = a - b * 2;
- BOOST_TEST(a == 100 - 30 * 2);
+ BOOST_CHECK_EQUAL(a , 100 - 30 * 2);
    a = 20;
    a = a * (b + 2);
- BOOST_TEST(a == 20 * (32));
+ BOOST_CHECK_EQUAL(a , 20 * (32));
    a = 20;
    a = (b + 2) * a;
- BOOST_TEST(a == 20 * (32));
+ BOOST_CHECK_EQUAL(a , 20 * (32));
    a = 90;
    b = 2;
    a = a / (b + 0);
- BOOST_TEST(a == 45);
+ BOOST_CHECK_EQUAL(a , 45);
    a = 20;
    b = 30;
    c = (a * b) + 22;
- BOOST_TEST(c == 20 * 30 + 22);
+ BOOST_CHECK_EQUAL(c , 20 * 30 + 22);
    c = 22 + (a * b);
- BOOST_TEST(c == 20 * 30 + 22);
+ BOOST_CHECK_EQUAL(c , 20 * 30 + 22);
    c = 10;
    ac = a + b * c;
- BOOST_TEST(ac == 20 + 30 * 10);
+ BOOST_CHECK_EQUAL(ac , 20 + 30 * 10);
    ac = b * c + a;
- BOOST_TEST(ac == 20 + 30 * 10);
+ BOOST_CHECK_EQUAL(ac , 20 + 30 * 10);
    a = a + b * c;
- BOOST_TEST(a == 20 + 30 * 10);
+ BOOST_CHECK_EQUAL(a , 20 + 30 * 10);
    a = 20;
    b = a + b * c;
- BOOST_TEST(b == 20 + 30 * 10);
+ BOOST_CHECK_EQUAL(b , 20 + 30 * 10);
    b = 30;
    c = a + b * c;
- BOOST_TEST(c == 20 + 30 * 10);
+ BOOST_CHECK_EQUAL(c , 20 + 30 * 10);
 
    //
    // Test conditionals:
@@ -1798,7 +1769,7 @@
 #endif
 #ifdef TEST_MPF
    boost::multiprecision::mpf_float::default_precision(1000);
- BOOST_TEST(boost::multiprecision::mpf_float::default_precision() == 1000);
+ BOOST_CHECK_EQUAL(boost::multiprecision::mpf_float::default_precision() , 1000);
    test<boost::multiprecision::mpf_float>();
 #endif
 #ifdef TEST_MPZ


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