Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r62807 - trunk/libs/serialization/test
From: ramey_at_[hidden]
Date: 2010-06-11 12:24:42


Author: ramey
Date: 2010-06-11 12:24:41 EDT (Fri, 11 Jun 2010)
New Revision: 62807
URL: http://svn.boost.org/trac/boost/changeset/62807

Log:
Improved test failure reporting for class A test class.
Text files modified:
   trunk/libs/serialization/test/test_simple_class.cpp | 44 +++++++++++++++++++++++++++++++++++++++
   1 files changed, 43 insertions(+), 1 deletions(-)

Modified: trunk/libs/serialization/test/test_simple_class.cpp
==============================================================================
--- trunk/libs/serialization/test/test_simple_class.cpp (original)
+++ trunk/libs/serialization/test/test_simple_class.cpp 2010-06-11 12:24:41 EDT (Fri, 11 Jun 2010)
@@ -27,6 +27,48 @@
 #include "A.hpp"
 #include "A.ipp"
 
+bool A::check_equal(const A &rhs) const
+{
+ BOOST_CHECK_EQUAL(b, rhs.b);
+ BOOST_CHECK_EQUAL(l, rhs.l);
+ #ifndef BOOST_NO_INT64_T
+ BOOST_CHECK_EQUAL(f, rhs.f);
+ BOOST_CHECK_EQUAL(g, rhs.g);
+ #endif
+ BOOST_CHECK_EQUAL(m, rhs.m);
+ BOOST_CHECK_EQUAL(n, rhs.n);
+ BOOST_CHECK_EQUAL(o, rhs.o);
+ BOOST_CHECK_EQUAL(p, rhs.p);
+ BOOST_CHECK_EQUAL(q, rhs.q);
+ #ifndef BOOST_NO_CWCHAR
+ BOOST_CHECK_EQUAL(r, rhs.r);
+ #endif
+ BOOST_CHECK_EQUAL(c, rhs.c);
+ BOOST_CHECK_EQUAL(s, rhs.s);
+ BOOST_CHECK_EQUAL(t, rhs.t);
+ BOOST_CHECK_EQUAL(u, rhs.u);
+ BOOST_CHECK_EQUAL(v, rhs.v);
+ BOOST_CHECK_EQUAL(l, rhs.l);
+ BOOST_CHECK(!(
+ w == 0
+ && std::fabs(rhs.w) > std::numeric_limits<float>::epsilon()
+ ));
+ BOOST_CHECK(!(
+ std::fabs(rhs.w/w - 1.0) > std::numeric_limits<float>::epsilon()
+ ));
+ BOOST_CHECK(!(
+ x == 0 && std::fabs(rhs.x - x) > std::numeric_limits<float>::epsilon()
+ ));
+ BOOST_CHECK(!(
+ std::fabs(rhs.x/x - 1.0) > std::numeric_limits<float>::epsilon()
+ ));
+ BOOST_CHECK(!(0 != y.compare(rhs.y)));
+ #ifndef BOOST_NO_STD_WSTRING
+ BOOST_CHECK(!(0 != z.compare(rhs.z)));
+ #endif
+ return true;
+}
+
 int
 test_main( int /* argc */, char* /* argv */[] )
 {
@@ -44,7 +86,7 @@
         test_iarchive ia(is, TEST_ARCHIVE_FLAGS);
         ia >> boost::serialization::make_nvp("a", a1);
     }
- BOOST_CHECK_EQUAL(a, a1);
+ a.check_equal(a1);
     std::remove(testfile);
     return 0;
 }


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