Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r51033 - sandbox/thread_safe_signals/trunk/libs/signals2/test
From: fmhess_at_[hidden]
Date: 2009-02-05 14:54:39


Author: fmhess
Date: 2009-02-05 14:54:39 EST (Thu, 05 Feb 2009)
New Revision: 51033
URL: http://svn.boost.org/trac/boost/changeset/51033

Log:
Added checks for double postconstructs.

Text files modified:
   sandbox/thread_safe_signals/trunk/libs/signals2/test/deconstruct_test.cpp | 21 ++++++++-------------
   1 files changed, 8 insertions(+), 13 deletions(-)

Modified: sandbox/thread_safe_signals/trunk/libs/signals2/test/deconstruct_test.cpp
==============================================================================
--- sandbox/thread_safe_signals/trunk/libs/signals2/test/deconstruct_test.cpp (original)
+++ sandbox/thread_safe_signals/trunk/libs/signals2/test/deconstruct_test.cpp 2009-02-05 14:54:39 EST (Thu, 05 Feb 2009)
@@ -23,6 +23,7 @@
 protected:
   virtual void postconstruct()
   {
+ BOOST_CHECK(!_postconstructed);
     _postconstructed = true;
   }
   bool _postconstructed;
@@ -57,6 +58,7 @@
 protected:
   virtual void postconstruct()
   {
+ BOOST_CHECK(!_postconstructed);
     _postconstructed = true;
   }
   bool _postconstructed;
@@ -75,26 +77,19 @@
     template<typename T> friend
       void adl_postconstruct(const boost::shared_ptr<T> &sp, A *p)
     {
- if(p)
- {
- p->_postconstructed = true;
- }
+ BOOST_CHECK(!p->_postconstructed);
+ p->_postconstructed = true;
     }
     template<typename T> friend
       void adl_postconstruct(const boost::shared_ptr<T> &sp, A *p, int val)
     {
- if(p)
- {
- p->value = val;
- p->_postconstructed = true;
- }
+ p->value = val;
+ BOOST_CHECK(!p->_postconstructed);
+ p->_postconstructed = true;
     }
     friend void adl_predestruct(A *p)
     {
- if(p)
- {
- p->_predestructed = true;
- }
+ p->_predestructed = true;
     }
     ~A()
     {


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