Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r81217 - trunk/boost/test/impl
From: gennadiy.rozental_at_[hidden]
Date: 2012-11-06 06:45:05


Author: rogeeff
Date: 2012-11-06 06:45:04 EST (Tue, 06 Nov 2012)
New Revision: 81217
URL: http://svn.boost.org/trac/boost/changeset/81217

Log:
fix initialization order
Text files modified:
   trunk/boost/test/impl/framework.ipp | 8 ++++++--
   1 files changed, 6 insertions(+), 2 deletions(-)

Modified: trunk/boost/test/impl/framework.ipp
==============================================================================
--- trunk/boost/test/impl/framework.ipp (original)
+++ trunk/boost/test/impl/framework.ipp 2012-11-06 06:45:04 EST (Tue, 06 Nov 2012)
@@ -329,8 +329,6 @@
     , m_test_in_progress( false )
     , m_context_idx( 0 )
     {
- m_master_test_suite = new master_test_suite_t;
- m_auto_test_suites.push_back( m_master_test_suite );
     }
 
     ~framework_impl() { clear(); }
@@ -953,6 +951,9 @@
 master_test_suite_t&
 master_test_suite()
 {
+ if( !s_frk_impl().m_master_test_suite )
+ s_frk_impl().m_master_test_suite = new master_test_suite_t;
+
     return *s_frk_impl().m_master_test_suite;
 }
 
@@ -965,6 +966,9 @@
 test_suite&
 current_auto_test_suite( test_suite* ts, bool push_or_pop )
 {
+ if( s_frk_impl().m_auto_test_suites.empty() )
+ s_frk_impl().m_auto_test_suites.push_back( &framework::master_test_suite() );
+
     if( !push_or_pop )
         s_frk_impl().m_auto_test_suites.pop_back();
     else if( ts )


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