Boost logo

Boost-Commit :

From: nesotto_at_[hidden]
Date: 2007-10-24 10:46:42


Author: nesotto
Date: 2007-10-24 10:46:42 EDT (Wed, 24 Oct 2007)
New Revision: 40417
URL: http://svn.boost.org/trac/boost/changeset/40417

Log:
some updates from 1,34 branch
Text files modified:
   trunk/libs/ptr_container/test/ptr_map.cpp | 5 +++--
   trunk/libs/ptr_container/test/serialization.cpp | 13 ++++++++++---
   2 files changed, 13 insertions(+), 5 deletions(-)

Modified: trunk/libs/ptr_container/test/ptr_map.cpp
==============================================================================
--- trunk/libs/ptr_container/test/ptr_map.cpp (original)
+++ trunk/libs/ptr_container/test/ptr_map.cpp 2007-10-24 10:46:42 EDT (Wed, 24 Oct 2007)
@@ -126,7 +126,8 @@
     c3.insert( c.begin(), c.end() );
     c.insert( c3 );
     c.erase( c.begin() );
- c3.erase( c3.begin(), c3.end() );
+ BOOST_CHECK( c3.end() == c3.erase( boost::make_iterator_range(c3) ) );
+ c3.erase( a_key );
 
     BOOST_CHECK( c3.empty() );
     c.swap( c3 );
@@ -329,7 +330,7 @@
     // @remark: taking the adress of an rvalue is not valid, though
     // many compilers accept it.
     //
- //map_type::pointer a_pointer = &*m2.begin();
+ // map_type::pointer a_pointer = &*m2.begin();
     //a_pointer->second->foo();
     //map_type::const_pointer a_cpointer = &*const_begin(m2);
    

Modified: trunk/libs/ptr_container/test/serialization.cpp
==============================================================================
--- trunk/libs/ptr_container/test/serialization.cpp (original)
+++ trunk/libs/ptr_container/test/serialization.cpp 2007-10-24 10:46:42 EDT (Wed, 24 Oct 2007)
@@ -125,7 +125,12 @@
     BOOST_CHECK_EQUAL( vec.size(), vec2.size() );
     BOOST_CHECK_EQUAL( (*vec2.begin()).i, -1 );
     BOOST_CHECK_EQUAL( (*--vec2.end()).i, 0 );
- BOOST_CHECK_EQUAL( dynamic_cast<Derived&>(*--vec2.end()).i2, 1 );
+
+ typename Cont::iterator i = vec2.end();
+ --i;
+ Derived* d = dynamic_cast<Derived*>( &*i );
+ BOOST_CHECK_EQUAL( d->i2, 1 );
+
 }
 
 template< class Map >
@@ -153,8 +158,10 @@
     BOOST_CHECK_EQUAL( m.size(), m2.size() );
     BOOST_CHECK_EQUAL( m2.find(key1)->second->i, -1 );
     BOOST_CHECK_EQUAL( m2.find(key2)->second->i, 0 );
- BOOST_CHECK_EQUAL( dynamic_cast<Derived&>( *m2.find(key2)->second ).i2, 1 );
-
+
+ typename Map::iterator i = m2.find(key2);
+ Derived* d = dynamic_cast<Derived*>( i->second );
+ BOOST_CHECK_EQUAL( d->i2, 1 );
 }
 
 //


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