Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r55420 - trunk/libs/serialization/test
From: ramey_at_[hidden]
Date: 2009-08-05 12:39:43


Author: ramey
Date: 2009-08-05 12:39:42 EDT (Wed, 05 Aug 2009)
New Revision: 55420
URL: http://svn.boost.org/trac/boost/changeset/55420

Log:
Fixed test again
Text files modified:
   trunk/libs/serialization/test/test_derived.cpp | 9 ++++++---
   1 files changed, 6 insertions(+), 3 deletions(-)

Modified: trunk/libs/serialization/test/test_derived.cpp
==============================================================================
--- trunk/libs/serialization/test/test_derived.cpp (original)
+++ trunk/libs/serialization/test/test_derived.cpp 2009-08-05 12:39:42 EDT (Wed, 05 Aug 2009)
@@ -107,6 +107,10 @@
     base *b1 = NULL;
     base *b2 = NULL;
     
+ // note: this will produce incorrect results for non-polymorphic classes
+ ia >> BOOST_SERIALIZATION_NVP(b1);
+ ia >> BOOST_SERIALIZATION_NVP(b2);
+
     // Warning, the current type id system does not yield true
     // type id for non-polymorphic types
     const boost::serialization::extended_type_info & this_type
@@ -122,9 +126,8 @@
         "current type id system does fails for non-polymorphic types"
     );
 
- // note: this will produce incorrect results for non-polymorphic classes
- ia >> BOOST_SERIALIZATION_NVP(b1);
- ia >> BOOST_SERIALIZATION_NVP(b2);
+ BOOST_CHECK(b1 == static_cast<base *>(d1));
+ BOOST_CHECK(b2 == static_cast<base *>(d2));
 
     delete d1;
     delete d2;


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