Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r75511 - in sandbox/big_number: boost/multiprecision boost/multiprecision/detail/functions libs/multiprecision/test
From: john_at_[hidden]
Date: 2011-11-16 12:36:42


Author: johnmaddock
Date: 2011-11-16 12:36:40 EST (Wed, 16 Nov 2011)
New Revision: 75511
URL: http://svn.boost.org/trac/boost/changeset/75511

Log:
Add enhanced testing support.
Remove throw statements for BOOST_THROW_EXCEPTION.
Remove throw() qualifiers: they're a dis-optimization.
Added:
   sandbox/big_number/libs/multiprecision/test/test_test.cpp (contents, props changed)
Text files modified:
   sandbox/big_number/boost/multiprecision/cpp_float.hpp | 22 ++--
   sandbox/big_number/boost/multiprecision/detail/functions/pow.hpp | 4
   sandbox/big_number/boost/multiprecision/detail/functions/trig.hpp | 4
   sandbox/big_number/libs/multiprecision/test/Jamfile.v2 | 1
   sandbox/big_number/libs/multiprecision/test/test.hpp | 193 ++++++++++++++++++++++++++++++++++++++++
   sandbox/big_number/libs/multiprecision/test/test_fpclassify.cpp | 9 -
   sandbox/big_number/libs/multiprecision/test/test_round.cpp | 7 -
   7 files changed, 211 insertions(+), 29 deletions(-)

Modified: sandbox/big_number/boost/multiprecision/cpp_float.hpp
==============================================================================
--- sandbox/big_number/boost/multiprecision/cpp_float.hpp (original)
+++ sandbox/big_number/boost/multiprecision/cpp_float.hpp 2011-11-16 12:36:40 EST (Wed, 16 Nov 2011)
@@ -2625,7 +2625,7 @@
    long long t = result.order();
 
    if(std::abs(t) > (std::numeric_limits<long long>::max)() / 3)
- throw std::runtime_error("Exponent is too large to be represented as a power of 2.");
+ BOOST_THROW_EXCEPTION(std::runtime_error("Exponent is too large to be represented as a power of 2."));
    t *= 3;
 
    result *= cpp_float<Digits10>::pow2(-t);
@@ -2651,7 +2651,7 @@
    long long t;
    eval_frexp(result, x, &t);
    if(t > (std::numeric_limits<int>::max)())
- throw std::runtime_error("Exponent is outside the range of an int");
+ BOOST_THROW_EXCEPTION(std::runtime_error("Exponent is outside the range of an int"));
    *e = static_cast<int>(t);
 }
 
@@ -2702,15 +2702,15 @@
       static const bool traps = false;
       static const bool tinyness_before = false;
 
- static const boost::multiprecision::mp_number<boost::multiprecision::cpp_float<Digits10> > (min) (void) throw() { return (boost::multiprecision::cpp_float<Digits10>::min)(); }
- static const boost::multiprecision::mp_number<boost::multiprecision::cpp_float<Digits10> > (max) (void) throw() { return (boost::multiprecision::cpp_float<Digits10>::max)(); }
- static const boost::multiprecision::mp_number<boost::multiprecision::cpp_float<Digits10> > lowest (void) throw() { return boost::multiprecision::cpp_float<Digits10>::zero(); }
- static const boost::multiprecision::mp_number<boost::multiprecision::cpp_float<Digits10> > epsilon (void) throw() { return boost::multiprecision::cpp_float<Digits10>::eps(); }
- static const boost::multiprecision::mp_number<boost::multiprecision::cpp_float<Digits10> > round_error (void) throw() { return 0.5L; }
- static const boost::multiprecision::mp_number<boost::multiprecision::cpp_float<Digits10> > infinity (void) throw() { return boost::multiprecision::cpp_float<Digits10>::inf(); }
- static const boost::multiprecision::mp_number<boost::multiprecision::cpp_float<Digits10> > quiet_NaN (void) throw() { return boost::multiprecision::cpp_float<Digits10>::nan(); }
- static const boost::multiprecision::mp_number<boost::multiprecision::cpp_float<Digits10> > signaling_NaN(void) throw() { return boost::multiprecision::cpp_float<Digits10>::zero(); }
- static const boost::multiprecision::mp_number<boost::multiprecision::cpp_float<Digits10> > denorm_min (void) throw() { return boost::multiprecision::cpp_float<Digits10>::zero(); }
+ static const boost::multiprecision::mp_number<boost::multiprecision::cpp_float<Digits10> > (min) (void) { return (boost::multiprecision::cpp_float<Digits10>::min)(); }
+ static const boost::multiprecision::mp_number<boost::multiprecision::cpp_float<Digits10> > (max) (void) { return (boost::multiprecision::cpp_float<Digits10>::max)(); }
+ static const boost::multiprecision::mp_number<boost::multiprecision::cpp_float<Digits10> > lowest (void) { return boost::multiprecision::cpp_float<Digits10>::zero(); }
+ static const boost::multiprecision::mp_number<boost::multiprecision::cpp_float<Digits10> > epsilon (void) { return boost::multiprecision::cpp_float<Digits10>::eps(); }
+ static const boost::multiprecision::mp_number<boost::multiprecision::cpp_float<Digits10> > round_error (void) { return 0.5L; }
+ static const boost::multiprecision::mp_number<boost::multiprecision::cpp_float<Digits10> > infinity (void) { return boost::multiprecision::cpp_float<Digits10>::inf(); }
+ static const boost::multiprecision::mp_number<boost::multiprecision::cpp_float<Digits10> > quiet_NaN (void) { return boost::multiprecision::cpp_float<Digits10>::nan(); }
+ static const boost::multiprecision::mp_number<boost::multiprecision::cpp_float<Digits10> > signaling_NaN(void) { return boost::multiprecision::cpp_float<Digits10>::zero(); }
+ static const boost::multiprecision::mp_number<boost::multiprecision::cpp_float<Digits10> > denorm_min (void) { return boost::multiprecision::cpp_float<Digits10>::zero(); }
    };
 }
 

Modified: sandbox/big_number/boost/multiprecision/detail/functions/pow.hpp
==============================================================================
--- sandbox/big_number/boost/multiprecision/detail/functions/pow.hpp (original)
+++ sandbox/big_number/boost/multiprecision/detail/functions/pow.hpp 2011-11-16 12:36:40 EST (Wed, 16 Nov 2011)
@@ -129,7 +129,7 @@
          x_pow_n_div_n_fact.negate();
    }
    if(n >= 300)
- throw std::runtime_error("H0F0 failed to converge");
+ BOOST_THROW_EXCEPTION(std::runtime_error("H0F0 failed to converge"));
 }
 
 template <class T>
@@ -178,7 +178,7 @@
          break;
    }
    if(n >= std::numeric_limits<mp_number<T> >::digits + 10)
- throw std::runtime_error("H1F0 failed to converge");
+ BOOST_THROW_EXCEPTION(std::runtime_error("H1F0 failed to converge"));
 }
 
 template <class T>

Modified: sandbox/big_number/boost/multiprecision/detail/functions/trig.hpp
==============================================================================
--- sandbox/big_number/boost/multiprecision/detail/functions/trig.hpp (original)
+++ sandbox/big_number/boost/multiprecision/detail/functions/trig.hpp 2011-11-16 12:36:40 EST (Wed, 16 Nov 2011)
@@ -61,7 +61,7 @@
    }
 
    if(n >= 300)
- throw std::runtime_error("H0F1 Failed to Converge");
+ BOOST_THROW_EXCEPTION(std::runtime_error("H0F1 Failed to Converge"));
 }
 
 
@@ -407,7 +407,7 @@
          break;
    }
    if(n > 300)
- throw std::runtime_error("H2F1 failed to converge.");
+ BOOST_THROW_EXCEPTION(std::runtime_error("H2F1 failed to converge."));
 }
 
 template <class T>

Modified: sandbox/big_number/libs/multiprecision/test/Jamfile.v2
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/Jamfile.v2 (original)
+++ sandbox/big_number/libs/multiprecision/test/Jamfile.v2 2011-11-16 12:36:40 EST (Wed, 16 Nov 2011)
@@ -583,3 +583,4 @@
         : test_fpclassify_cpp_float ;
 
 
+run test_test.cpp ;
\ No newline at end of file

Modified: sandbox/big_number/libs/multiprecision/test/test.hpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/test.hpp (original)
+++ sandbox/big_number/libs/multiprecision/test/test.hpp 2011-11-16 12:36:40 EST (Wed, 16 Nov 2011)
@@ -5,6 +5,10 @@
 #include <limits>
 #include <cmath>
 
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/current_function.hpp>
+#include <boost/static_assert.hpp>
+
 template <class T>
 T relative_error(T a, T b)
 {
@@ -41,4 +45,193 @@
    return (std::max)(fabs((a-b)/a), fabs((a-b)/b)) / std::numeric_limits<T>::epsilon();
 }
 
+enum
+{
+ warn_on_fail,
+ error_on_fail,
+ abort_on_fail
+};
+
+template <class T>
+inline T epsilon_of(const T&)
+{
+ BOOST_STATIC_ASSERT(std::numeric_limits<T>::is_specialized);
+ return std::numeric_limits<T>::epsilon();
+}
+
+template <class T>
+inline int digits_of(const T&)
+{
+ return std::numeric_limits<T>::is_specialized ? std::numeric_limits<T>::digits10 + 2 : std::numeric_limits<long double>::digits10 + 2;
+}
+
+inline std::ostream& report_where(const char* file, int line, const char* function)
+{
+ if(function)
+ BOOST_LIGHTWEIGHT_TEST_OSTREAM << "In function: "<< function << std::endl;
+ BOOST_LIGHTWEIGHT_TEST_OSTREAM << file << ":" << line;
+ return BOOST_LIGHTWEIGHT_TEST_OSTREAM;
+}
+
+#define BOOST_MP_REPORT_WHERE report_where(__FILE__, __LINE__, BOOST_CURRENT_FUNCTION)
+
+inline void report_severity(int severity)
+{
+ if(severity == error_on_fail)
+ ++boost::detail::test_errors();
+ else if(severity == abort_on_fail)
+ {
+ ++boost::detail::test_errors();
+ abort();
+ }
+}
+
+#define BOOST_MP_REPORT_SEVERITY(severity) report_severity(severity)
+
+template <class E>
+void report_unexpected_exception(const E& e, int severity, const char* file, int line, const char* function)
+{
+ report_where(file, line, function) << " Unexpected exception of type " << typeid(e).name() << std::endl;
+ BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Errot message was: " << e.what() << std::endl;
+ BOOST_MP_REPORT_SEVERITY(severity);
+}
+
+#define BOOST_MP_UNEXPECTED_EXCEPTION_CHECK(severity) catch(const std::exception& e) { report_unexpected_exception(e, severity, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION); }
+
+
+#define BOOST_CHECK_IMP(x, severity)\
+ try{ if(x){}else{\
+ BOOST_MP_REPORT_WHERE << " Failed predicate: " << BOOST_STRINGIZE(x) << std::endl;\
+ BOOST_MP_REPORT_SEVERITY(severity);\
+ }\
+ }BOOST_MP_UNEXPECTED_EXCEPTION_CHECK(severity)
+
+#define BOOST_CHECK(x) BOOST_CHECK_IMP(x, error_on_fail)
+#define BOOST_WARN(x) BOOST_CHECK_IMP(x, warn_on_fail)
+#define BOOST_REQUIRE(x) BOOST_CHECK_IMP(x, abort_on_fail)
+
+#define BOOST_CLOSE_IMP(x, y, tol, severity)\
+ try{ if(relative_error(x, y) > tol){\
+ BOOST_MP_REPORT_WHERE << " Failed check for closeness: \n" \
+ << std::setprecision(digits_of(x)) << std::scientific\
+ << "Value of LHS was: " << x << "\n"\
+ << "Value of RHS was: " << y << "\n"\
+ << std::setprecision(3)\
+ << "Relative error was: " << relative_error(x, y) << "eps\n"\
+ << "Tolerance was: " << tol << "eps" << std::endl;\
+ BOOST_MP_REPORT_SEVERITY(severity);\
+ }\
+ }BOOST_MP_UNEXPECTED_EXCEPTION_CHECK(severity)
+
+#define BOOST_EQUAL_IMP(x, y, severity)\
+ 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"\
+ << std::setprecision(3) << std::endl;\
+ BOOST_MP_REPORT_SEVERITY(severity);\
+ }\
+ }BOOST_MP_UNEXPECTED_EXCEPTION_CHECK(severity)
+
+#define BOOST_NE_IMP(x, y, severity)\
+ try{ if(!(x != y)){\
+ BOOST_MP_REPORT_WHERE << " Failed check for non-equality: \n" \
+ << std::setprecision(digits_of(x)) << std::scientific\
+ << "Value of LHS was: " << x << "\n"\
+ << "Value of RHS was: " << y << "\n"\
+ << std::setprecision(3) << std::endl;\
+ BOOST_MP_REPORT_SEVERITY(severity);\
+ }\
+ }BOOST_MP_UNEXPECTED_EXCEPTION_CHECK(severity)
+
+#define BOOST_LT_IMP(x, y, severity)\
+ try{ if(!(x < y)){\
+ BOOST_MP_REPORT_WHERE << " Failed check for less than: \n" \
+ << std::setprecision(digits_of(x)) << std::scientific\
+ << "Value of LHS was: " << x << "\n"\
+ << "Value of RHS was: " << y << "\n"\
+ << std::setprecision(3) << std::endl;\
+ BOOST_MP_REPORT_SEVERITY(severity);\
+ }\
+ }BOOST_MP_UNEXPECTED_EXCEPTION_CHECK(severity)
+
+#define BOOST_GT_IMP(x, y, severity)\
+ try{ if(!(x > y)){\
+ BOOST_MP_REPORT_WHERE << " Failed check for greater than: \n" \
+ << std::setprecision(digits_of(x)) << std::scientific\
+ << "Value of LHS was: " << x << "\n"\
+ << "Value of RHS was: " << y << "\n"\
+ << std::setprecision(3) << std::endl;\
+ BOOST_MP_REPORT_SEVERITY(severity);\
+ }\
+ }BOOST_MP_UNEXPECTED_EXCEPTION_CHECK(severity)
+
+#define BOOST_LE_IMP(x, y, severity)\
+ try{ if(!(x <= y)){\
+ BOOST_MP_REPORT_WHERE << " Failed check for less-than-equal-to: \n" \
+ << std::setprecision(digits_of(x)) << std::scientific\
+ << "Value of LHS was: " << x << "\n"\
+ << "Value of RHS was: " << y << "\n"\
+ << std::setprecision(3) << std::endl;\
+ BOOST_MP_REPORT_SEVERITY(severity);\
+ }\
+ }BOOST_MP_UNEXPECTED_EXCEPTION_CHECK(severity)
+
+#define BOOST_GE_IMP(x, y, severity)\
+ try{ if(!(x >= y)){\
+ BOOST_MP_REPORT_WHERE << " Failed check for greater-than-equal-to \n" \
+ << std::setprecision(digits_of(x)) << std::scientific\
+ << "Value of LHS was: " << x << "\n"\
+ << "Value of RHS was: " << y << "\n"\
+ << std::setprecision(3) << std::endl;\
+ BOOST_MP_REPORT_SEVERITY(severity);\
+ }\
+ }BOOST_MP_UNEXPECTED_EXCEPTION_CHECK(severity)
+
+#define BOOST_MT_CHECK_THROW_IMP(x, E, severity)\
+ try{ \
+ x;\
+ BOOST_MP_REPORT_WHERE << " Expected exception not thrown in expression " << BOOST_STRINGIZE(x) << std::endl;\
+ BOOST_MP_REPORT_SEVERITY(severity);\
+ }\
+ catch(const E&){}\
+ BOOST_MP_UNEXPECTED_EXCEPTION_CHECK(severity)
+
+#define BOOST_CHECK_CLOSE(x, y, tol) BOOST_CLOSE_IMP(x, y, ((tol / (100 * epsilon_of(x)))), error_on_fail)
+#define BOOST_WARN_CLOSE(x, y, tol) BOOST_CLOSE_IMP(x, y, (tol / (100 * epsilon_of(x))), warn_on_fail)
+#define BOOST_REQUIRE_CLOSE(x, y, tol) BOOST_CLOSE_IMP(x, y, (tol / (100 * epsilon_of(x))), abort_on_fail)
+
+#define BOOST_CHECK_CLOSE_FRACTION(x, y, tol) BOOST_CLOSE_IMP(x, y, ((tol / (epsilon_of(x)))), error_on_fail)
+#define BOOST_WARN_CLOSE_FRACTION(x, y, tol) BOOST_CLOSE_IMP(x, y, (tol / (epsilon_of(x))), warn_on_fail)
+#define BOOST_REQUIRE_CLOSE_FRACTION(x, y, tol) BOOST_CLOSE_IMP(x, y, (tol / (epsilon_of(x))), abort_on_fail)
+
+#define BOOST_CHECK_EQUAL(x, y) BOOST_EQUAL_IMP(x, y, error_on_fail)
+#define BOOST_WARN_EQUAL(x, y) BOOST_EQUAL_IMP(x, y, warn_on_fail)
+#define BOOST_REQUIRE_EQUAL(x, y) BOOST_EQUAL_IMP(x, y, abort_on_fail)
+
+#define BOOST_CHECK_NE(x, y) BOOST_NE_IMP(x, y, error_on_fail)
+#define BOOST_WARN_NE(x, y) BOOST_NE_IMP(x, y, warn_on_fail)
+#define BOOST_REQUIRE_NE(x, y) BOOST_NE_IMP(x, y, abort_on_fail)
+
+#define BOOST_CHECK_LT(x, y) BOOST_LT_IMP(x, y, error_on_fail)
+#define BOOST_WARN_LT(x, y) BOOST_LT_IMP(x, y, warn_on_fail)
+#define BOOST_REQUIRE_LT(x, y) BOOST_LT_IMP(x, y, abort_on_fail)
+
+#define BOOST_CHECK_GT(x, y) BOOST_GT_IMP(x, y, error_on_fail)
+#define BOOST_WARN_GT(x, y) BOOST_GT_IMP(x, y, warn_on_fail)
+#define BOOST_REQUIRE_GT(x, y) BOOST_GT_IMP(x, y, abort_on_fail)
+
+#define BOOST_CHECK_LE(x, y) BOOST_LE_IMP(x, y, error_on_fail)
+#define BOOST_WARN_LE(x, y) BOOST_LE_IMP(x, y, warn_on_fail)
+#define BOOST_REQUIRE_LE(x, y) BOOST_LE_IMP(x, y, abort_on_fail)
+
+#define BOOST_CHECK_GE(x, y) BOOST_GE_IMP(x, y, error_on_fail)
+#define BOOST_WARN_GE(x, y) BOOST_GE_IMP(x, y, warn_on_fail)
+#define BOOST_REQUIRE_GE(x, y) BOOST_GE_IMP(x, y, abort_on_fail)
+
+#define BOOST_CHECK_THROW(x, E) BOOST_MT_CHECK_THROW_IMP(x, E, error_on_fail)
+#define BOOST_WARN_THROW(x, E) BOOST_MT_CHECK_THROW_IMP(x, E, warn_on_fail)
+#define BOOST_REQUIRE_THROW(x, E) BOOST_MT_CHECK_THROW_IMP(x, E, abort_on_fail)
+
 #endif

Modified: sandbox/big_number/libs/multiprecision/test/test_fpclassify.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/test_fpclassify.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/test_fpclassify.cpp 2011-11-16 12:36:40 EST (Wed, 16 Nov 2011)
@@ -8,7 +8,7 @@
 #include <math.h>
 #include <boost/limits.hpp>
 #include <boost/math/special_functions/fpclassify.hpp>
-#include <boost/detail/lightweight_test.hpp>
+#include "test.hpp"
 
 #if !defined(TEST_MPF_50) && !defined(TEST_MPF) && !defined(TEST_BACKEND) && !defined(TEST_MPZ) && !defined(TEST_CPP_FLOAT) && !defined(TEST_MPFR) && !defined(TEST_MPFR_50) && !defined(TEST_MPQ)
 # define TEST_MPF_50
@@ -42,13 +42,6 @@
 #pragma warning(disable: 4127) // conditional expression is constant
 #endif
 
-#define BOOST_CHECK_EQUAL(x, y)\
- if(x != y)\
- {\
- BOOST_ERROR("Values were not equal.");\
- BOOST_LIGHTWEIGHT_TEST_OSTREAM << x << " != " << y << std::endl;\
- }
-
 const char* method_name(const boost::math::detail::native_tag&)
 {
    return "Native";

Modified: sandbox/big_number/libs/multiprecision/test/test_round.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/test_round.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/test_round.cpp 2011-11-16 12:36:40 EST (Wed, 16 Nov 2011)
@@ -9,12 +9,7 @@
 #include <boost/math/special_functions/modf.hpp>
 #include <boost/math/special_functions/sign.hpp>
 #include <boost/random/mersenne_twister.hpp>
-
-#define BOOST_CHECK_THROW(x, EX)\
- try { x; BOOST_ERROR("Expected exception not thrown"); } \
- catch(const EX&){}\
- catch(...){ BOOST_ERROR("Incorrect exception type thrown"); }
-
+#include "test.hpp"
 
 #if !defined(TEST_MPF_50) && !defined(TEST_MPF) && !defined(TEST_BACKEND) && !defined(TEST_MPZ) && !defined(TEST_CPP_FLOAT) && !defined(TEST_MPFR) && !defined(TEST_MPFR_50) && !defined(TEST_MPQ)
 # define TEST_MPF_50

Added: sandbox/big_number/libs/multiprecision/test/test_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/big_number/libs/multiprecision/test/test_test.cpp 2011-11-16 12:36:40 EST (Wed, 16 Nov 2011)
@@ -0,0 +1,85 @@
+///////////////////////////////////////////////////////////////
+// Copyright 2011 John Maddock. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_
+
+#include "test.hpp"
+#include <boost/multiprecision/cpp_float.hpp>
+
+void proc_that_throws()
+{
+ throw std::runtime_error("");
+}
+
+int main()
+{
+ boost::multiprecision::cpp_float_50 a1(1), a2(1), b(3), c(-2);
+
+ BOOST_WARN(a1);
+ BOOST_WARN(a1 == b);
+ BOOST_CHECK(a1);
+ BOOST_CHECK(a1 == b);
+ BOOST_CHECK(boost::detail::test_errors() == 1);
+ --boost::detail::test_errors();
+
+ boost::multiprecision::cpp_float_50 a_tol = a1 + a1 * 100 * std::numeric_limits<boost::multiprecision::cpp_float_50>::epsilon();
+ boost::multiprecision::cpp_float_50 tol = 100 * std::numeric_limits<boost::multiprecision::cpp_float_50>::epsilon();
+
+ BOOST_CHECK_CLOSE(a1, a_tol, tol * 102); // Passes
+ BOOST_WARN_CLOSE(a1, a_tol, tol * 98); // fails
+ BOOST_CHECK_CLOSE(a1, a_tol, tol * 98); // fails
+ BOOST_CHECK(boost::detail::test_errors() == 1);
+ --boost::detail::test_errors();
+
+ BOOST_CHECK_CLOSE_FRACTION(a1, a_tol, tol * 1.02); // Passes
+ BOOST_WARN_CLOSE_FRACTION(a1, a_tol, tol * 0.98); // fails
+ BOOST_CHECK_CLOSE_FRACTION(a1, a_tol, tol * 0.98); // fails
+ BOOST_CHECK(boost::detail::test_errors() == 1);
+ --boost::detail::test_errors();
+
+ BOOST_CHECK_EQUAL(a1, a2);
+ BOOST_WARN_EQUAL(a1, b);
+ BOOST_CHECK_EQUAL(a1, b);
+ BOOST_CHECK(boost::detail::test_errors() == 1);
+ --boost::detail::test_errors();
+
+ BOOST_CHECK_NE(a1, b);
+ BOOST_WARN_NE(a1, a2);
+ BOOST_CHECK_NE(a1, a2);
+ BOOST_CHECK(boost::detail::test_errors() == 1);
+ --boost::detail::test_errors();
+
+ BOOST_CHECK_GT(a1, c);
+ BOOST_WARN_GT(a1, a2);
+ BOOST_CHECK_GT(a1, a2);
+ BOOST_CHECK(boost::detail::test_errors() == 1);
+ --boost::detail::test_errors();
+
+ BOOST_CHECK_LT(a1, b);
+ BOOST_WARN_LT(a1, a2);
+ BOOST_CHECK_LT(a1, a2);
+ BOOST_CHECK(boost::detail::test_errors() == 1);
+ --boost::detail::test_errors();
+
+ BOOST_CHECK_GE(a1, a2);
+ BOOST_CHECK_GE(a1, c);
+ BOOST_WARN_GE(a1, b);
+ BOOST_CHECK_GE(a1, b);
+ BOOST_CHECK(boost::detail::test_errors() == 1);
+ --boost::detail::test_errors();
+
+ BOOST_CHECK_LE(a1, a2);
+ BOOST_CHECK_LE(a1, b);
+ BOOST_WARN_LE(a1, c);
+ BOOST_CHECK_LE(a1, c);
+ BOOST_CHECK(boost::detail::test_errors() == 1);
+ --boost::detail::test_errors();
+
+ BOOST_CHECK_THROW(proc_that_throws(), std::runtime_error);
+ BOOST_CHECK_THROW(a1+b+c, std::runtime_error);
+ BOOST_CHECK(boost::detail::test_errors() == 1);
+ --boost::detail::test_errors();
+
+ return boost::report_errors();
+}
+


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