|
Boost-Commit : |
From: nesotto_at_[hidden]
Date: 2007-10-22 18:51:42
Author: nesotto
Date: 2007-10-22 18:51:42 EDT (Mon, 22 Oct 2007)
New Revision: 40307
URL: http://svn.boost.org/trac/boost/changeset/40307
Log:
update of test to try copyability
Text files modified:
trunk/libs/ptr_container/test/associative_test_data.hpp | 14 +++++++++++++-
trunk/libs/ptr_container/test/sequence_test_data.hpp | 11 ++++++++++-
2 files changed, 23 insertions(+), 2 deletions(-)
Modified: trunk/libs/ptr_container/test/associative_test_data.hpp
==============================================================================
--- trunk/libs/ptr_container/test/associative_test_data.hpp (original)
+++ trunk/libs/ptr_container/test/associative_test_data.hpp 2007-10-22 18:51:42 EDT (Mon, 22 Oct 2007)
@@ -25,13 +25,25 @@
enum { max_cnt = 10, size = 100 };
C c;
BOOST_CHECK( c.size() == 0 );
-
+ c.insert( c.end(), new T );
+ c.insert( c.end(), new T );
+
const C c2( c.begin(), c.end() );
BOOST_CHECK( c.size() == c2.size() );
C c3;
BOOST_MESSAGE( "finished construction test" );
+
+ C a_copy( c );
+ BOOST_CHECK_EQUAL( a_copy.size(), c.size() );
+ a_copy = a_copy;
+ BOOST_CHECK_EQUAL( a_copy.size(), c.size() );
+ c.clear();
+ a_copy = c;
+ a_copy = a_copy;
+ BOOST_CHECK( a_copy.empty() );
+ BOOST_MESSAGE( "finished copying test" );
BOOST_DEDUCED_TYPENAME C::allocator_type alloc = c.get_allocator();
BOOST_DEDUCED_TYPENAME C::iterator i = c.begin();
Modified: trunk/libs/ptr_container/test/sequence_test_data.hpp
==============================================================================
--- trunk/libs/ptr_container/test/sequence_test_data.hpp (original)
+++ trunk/libs/ptr_container/test/sequence_test_data.hpp 2007-10-22 18:51:42 EDT (Mon, 22 Oct 2007)
@@ -42,7 +42,16 @@
c.assign( c3 );
BOOST_MESSAGE( "finished construction test" );
-
+
+ C a_copy( c );
+ BOOST_CHECK_EQUAL( a_copy.size(), c.size() );
+ a_copy = a_copy;
+ BOOST_CHECK_EQUAL( a_copy.size(), c.size() );
+ a_copy.clear();
+ a_copy = a_copy;
+ BOOST_CHECK( a_copy.empty() );
+ BOOST_MESSAGE( "finished copying test" );
+
BOOST_DEDUCED_TYPENAME C::allocator_type alloc = c.get_allocator();
hide_warning(alloc);
BOOST_DEDUCED_TYPENAME C::iterator i = c.begin();
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