Boost logo

Boost-Commit :

From: nielsdekker_at_[hidden]
Date: 2007-12-03 16:41:59


Author: niels_dekker
Date: 2007-12-03 16:41:59 EST (Mon, 03 Dec 2007)
New Revision: 41667
URL: http://svn.boost.org/trac/boost/changeset/41667

Log:
Added value_init test for an value_initialized<T> object allocated on the heap.

Text files modified:
   trunk/libs/utility/value_init_test.cpp | 5 +++++
   1 files changed, 5 insertions(+), 0 deletions(-)

Modified: trunk/libs/utility/value_init_test.cpp
==============================================================================
--- trunk/libs/utility/value_init_test.cpp (original)
+++ trunk/libs/utility/value_init_test.cpp 2007-12-03 16:41:59 EST (Mon, 03 Dec 2007)
@@ -13,6 +13,7 @@
 #include <string>
 
 #include "boost/utility/value_init.hpp"
+#include <boost/shared_ptr.hpp>
 
 #ifdef __BORLANDC__
 #pragma hdrstop
@@ -178,6 +179,9 @@
   x_c_ref = z ;
   BOOST_CHECK ( x_c == z ) ;
 
+ boost::shared_ptr<boost::value_initialized<T> > ptr( new boost::value_initialized<T> );
+ BOOST_CHECK ( y == *ptr ) ;
+
 #if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
   boost::value_initialized<T const> cx ;
   BOOST_CHECK ( y == cx ) ;
@@ -187,6 +191,7 @@
   BOOST_CHECK ( y == cx_c ) ;
   BOOST_CHECK ( y == boost::get(cx_c) ) ;
 #endif
+
   return boost::minimal_test::errors_counter() == counter_before_test ;
 }
 


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