Boost logo

Boost-Commit :

From: jmcintyre_at_[hidden]
Date: 2007-08-02 21:45:51


Author: jared
Date: 2007-08-02 21:45:48 EDT (Thu, 02 Aug 2007)
New Revision: 38410
URL: http://svn.boost.org/trac/boost/changeset/38410

Log:
all important test ported and running
Text files modified:
   sandbox/pinhole/boost/pinhole/property_group_wrapper.h | 2
   sandbox/pinhole/libs/pinhole/test/Jamfile.v2 | 4
   sandbox/pinhole/libs/pinhole/test/TestActions.cpp | 38 ++++++++++------
   sandbox/pinhole/libs/pinhole/test/TestPropertyGroupWrapper.cpp | 92 ++++++++++++++++++++--------------------
   sandbox/pinhole/libs/pinhole/test/TestPropertyGroups.cpp | 87 +++++++++++++++++++++----------------
   5 files changed, 123 insertions(+), 100 deletions(-)

Modified: sandbox/pinhole/boost/pinhole/property_group_wrapper.h
==============================================================================
--- sandbox/pinhole/boost/pinhole/property_group_wrapper.h (original)
+++ sandbox/pinhole/boost/pinhole/property_group_wrapper.h 2007-08-02 21:45:48 EDT (Thu, 02 Aug 2007)
@@ -25,7 +25,7 @@
          * @param name The name of this property group (like an xml node name)
          * @param parent The parent of the this object.
          */
- property_group_wrapper(std::string name, property_group *parent) :
+ property_group_wrapper(std::string name, property_group *parent)
             : property_group(name, parent){;}
         
         ~property_group_wrapper(void){;}

Modified: sandbox/pinhole/libs/pinhole/test/Jamfile.v2
==============================================================================
--- sandbox/pinhole/libs/pinhole/test/Jamfile.v2 (original)
+++ sandbox/pinhole/libs/pinhole/test/Jamfile.v2 2007-08-02 21:45:48 EDT (Thu, 02 Aug 2007)
@@ -21,7 +21,7 @@
   test-suite pinhole
     :
   [ run TestPropertyGroups.cpp ]
- #[ run TestPropertyGroupWrapper.cpp ]
+ [ run TestPropertyGroupWrapper.cpp ]
   
   [ run TestBoolProperties.cpp ]
   [ run TestDoubleProperties.cpp ]
@@ -29,7 +29,7 @@
   [ run TestIntegerProperties.cpp ]
   [ run TestStringProperties.cpp ]
   
- #[ run TestActions.cpp ]
+ [ run TestActions.cpp ]
   
   #[ run TestSerializer.cpp ]
  ;

Modified: sandbox/pinhole/libs/pinhole/test/TestActions.cpp
==============================================================================
--- sandbox/pinhole/libs/pinhole/test/TestActions.cpp (original)
+++ sandbox/pinhole/libs/pinhole/test/TestActions.cpp 2007-08-02 21:45:48 EDT (Thu, 02 Aug 2007)
@@ -11,28 +11,38 @@
 #include <boost/test/unit_test.hpp>
 #include "TestClassesAndConstants.h"
 
-BOOST_AUTO_TEST_CASE( TestActionsFixture, TestTriggerAction )
+// I can hide these two line if I don't do everything in headers
+boost::shared_ptr<property_manager> property_manager::m_instance(new property_manager);
+event_source* event_source::m_instance = 0;
+
+BOOST_AUTO_TEST_CASE( TestTriggerAction )
 {
- BOOST_CHECK_EQUAL(bTriggeredAction1, false);
- Trigger(ACTION_1);
- BOOST_CHECK_EQUAL(bTriggeredAction1, true);
-
- BOOST_CHECK_EQUAL(bTriggeredAction2, false);
- Trigger(ACTION_2);
- BOOST_CHECK_EQUAL(bTriggeredAction2, true);
+ TestActionsFixture testFixture;
+
+ BOOST_CHECK_EQUAL(testFixture.bTriggeredAction1, false);
+ testFixture.trigger(ACTION_1);
+ BOOST_CHECK_EQUAL(testFixture.bTriggeredAction1, true);
+
+ BOOST_CHECK_EQUAL(testFixture.bTriggeredAction2, false);
+ testFixture.trigger(ACTION_2);
+ BOOST_CHECK_EQUAL(testFixture.bTriggeredAction2, true);
 }
 
-BOOST_AUTO_TEST_CASE( TestActionsFixture, TestNonExistentAction )
+BOOST_AUTO_TEST_CASE( TestNonExistentAction )
 {
- CHECK_THROW( Trigger("NonExistent Action"), std::out_of_range );
+ TestActionsFixture testFixture;
+
+ BOOST_CHECK_THROW( testFixture.trigger("NonExistent Action"), std::out_of_range );
 }
 
-BOOST_AUTO_TEST_CASE( TestActionsFixture, TestGetActionCollection )
+BOOST_AUTO_TEST_CASE( TestGetActionCollection )
 {
- property_group::action_iterator itr = action_begin();
- property_group::action_iterator itrEnd = action_end();
+ TestActionsFixture testFixture;
+
+ property_group::action_iterator itr = testFixture.action_begin();
+ property_group::action_iterator itrEnd = testFixture.action_end();
 
- BOOST_CHECK_EQUAL( action_count(), 2 );
+ BOOST_CHECK_EQUAL( testFixture.action_count(), 2u );
     BOOST_CHECK_EQUAL( *itr, ACTION_1 );
     ++itr;
     BOOST_CHECK_EQUAL( *itr, ACTION_2 );

Modified: sandbox/pinhole/libs/pinhole/test/TestPropertyGroupWrapper.cpp
==============================================================================
--- sandbox/pinhole/libs/pinhole/test/TestPropertyGroupWrapper.cpp (original)
+++ sandbox/pinhole/libs/pinhole/test/TestPropertyGroupWrapper.cpp 2007-08-02 21:45:48 EDT (Thu, 02 Aug 2007)
@@ -19,135 +19,135 @@
 BOOST_AUTO_TEST_CASE( TestPropertyGroupWrapper_Bool )
 {
         TestPropertyGroup_4 baseObject;
- property_group_Wrapper wrapper("BOOST_AUTO_TEST_CASE", &baseObject);
+ property_group_wrapper wrapper("test_wrapper", &baseObject);
         const Editor *pEditor;
 
         // Test Standard Creation
- wrapper.AddProperty<bool>(PROPERTY_BOOL, "PropertyBool description", boost::bind(&TestPropertyGroup_4::SetBool, &baseObject, _1), boost::bind(&TestPropertyGroup_4::GetBool, &baseObject), new BoolEditor());
+ wrapper.add_property<bool>(PROPERTY_BOOL, "PropertyBool description", boost::bind(&TestPropertyGroup_4::SetBool, &baseObject, _1), boost::bind(&TestPropertyGroup_4::GetBool, &baseObject), new BoolEditor());
 
- wrapper.testGroup.set_as_string( PROPERTY_BOOL, BOOL_FALSE );
- BOOST_CHECK( wrapper.testGroup.get_as_string( PROPERTY_BOOL ) == BOOL_FALSE );
+ wrapper.set_as_string( PROPERTY_BOOL, BOOL_FALSE );
+ BOOST_CHECK( wrapper.get_as_string( PROPERTY_BOOL ) == BOOL_FALSE );
         
- wrapper.testGroup.set_as_string( PROPERTY_BOOL, BOOL_TRUE );
- BOOST_CHECK( wrapper.testGroup.get_as_string( PROPERTY_BOOL ) == BOOL_TRUE );
+ wrapper.set_as_string( PROPERTY_BOOL, BOOL_TRUE );
+ BOOST_CHECK( wrapper.get_as_string( PROPERTY_BOOL ) == BOOL_TRUE );
 
- pEditor = wrapper.testGroup.get_metadata( PROPERTY_BOOL );
+ pEditor = wrapper.get_metadata( PROPERTY_BOOL );
         BOOST_CHECK( pEditor->getEditorPropertyType() == BooleanType );
         BOOST_CHECK( pEditor->GetControlType() == Radio );
 
         // Test Auto-Generated Designer Creation
- property_group_Wrapper wrapperAutoGenDesigner("BOOST_AUTO_TEST_CASE", &baseObject);
+ property_group_wrapper wrapperAutoGenDesigner("test_wrapper", &baseObject);
 
- wrapperAutoGenDesigner.AddProperty<bool>(PROPERTY_BOOL, "PropertyBool description", boost::bind(&TestPropertyGroup_4::SetBool, &baseObject, _1), boost::bind(&TestPropertyGroup_4::GetBool, &baseObject) );
+ wrapperAutoGenDesigner.add_property<bool>(PROPERTY_BOOL, "PropertyBool description", boost::bind(&TestPropertyGroup_4::SetBool, &baseObject, _1), boost::bind(&TestPropertyGroup_4::GetBool, &baseObject) );
 
- pEditor = wrapperAutoGenDesigner.testGroup.get_metadata(PROPERTY_BOOL);
+ pEditor = wrapperAutoGenDesigner.get_metadata(PROPERTY_BOOL);
         BOOST_CHECK( NULL != dynamic_cast<const BoolEditor*>(pEditor) );
 }
 
 BOOST_AUTO_TEST_CASE( TestPropertyGroupWrapper_Double )
 {
         TestPropertyGroup_5 baseObject;
- property_group_Wrapper wrapper("BOOST_AUTO_TEST_CASE", &baseObject);
+ property_group_wrapper wrapper("test_wrapper", &baseObject);
         const Editor *pEditor;
 
         // Test Standard Creation
- wrapper.AddProperty<double>(PROPERTY_DOUBLE, "PropertyDouble description", boost::bind(&TestPropertyGroup_5::SetDouble, &baseObject, _1), boost::bind(&TestPropertyGroup_5::GetDouble, &baseObject), new DoubleEditor() );
+ wrapper.add_property<double>(PROPERTY_DOUBLE, "PropertyDouble description", boost::bind(&TestPropertyGroup_5::SetDouble, &baseObject, _1), boost::bind(&TestPropertyGroup_5::GetDouble, &baseObject), new DoubleEditor() );
 
         double dValue;
- wrapper.testGroup.set_as_string( PROPERTY_DOUBLE, PROPERTY_DOUBLE_STRING_VALUE );
- BOOST_CHECK( from_string<double>(dValue, wrapper.testGroup.get_as_string( PROPERTY_DOUBLE), std::dec) );
- CHECK_CLOSE( dValue, PROPERTY_DOUBLE_VALUE, 0.01 );
+ wrapper.set_as_string( PROPERTY_DOUBLE, PROPERTY_DOUBLE_STRING_VALUE );
+ BOOST_CHECK( from_string<double>(dValue, wrapper.get_as_string( PROPERTY_DOUBLE), std::dec) );
+ BOOST_CHECK_EQUAL( dValue, PROPERTY_DOUBLE_VALUE );
 
- pEditor = wrapper.testGroup.get_metadata( PROPERTY_DOUBLE );
+ pEditor = wrapper.get_metadata( PROPERTY_DOUBLE );
         BOOST_CHECK( pEditor->getEditorPropertyType() == DoubleType );
         BOOST_CHECK( pEditor->GetControlType() == EditBox );
 
         // Test Auto-Generated Designer Creation
- property_group_Wrapper wrapperAutoGenDesigner("BOOST_AUTO_TEST_CASE", &baseObject);
+ property_group_wrapper wrapperAutoGenDesigner("test_wrapper", &baseObject);
 
- wrapperAutoGenDesigner.AddProperty<double>(PROPERTY_DOUBLE, "PropertyDouble description", boost::bind(&TestPropertyGroup_5::SetDouble, &baseObject, _1), boost::bind(&TestPropertyGroup_5::GetDouble, &baseObject) );
+ wrapperAutoGenDesigner.add_property<double>(PROPERTY_DOUBLE, "PropertyDouble description", boost::bind(&TestPropertyGroup_5::SetDouble, &baseObject, _1), boost::bind(&TestPropertyGroup_5::GetDouble, &baseObject) );
 
- pEditor = wrapperAutoGenDesigner.testGroup.get_metadata(PROPERTY_DOUBLE);
+ pEditor = wrapperAutoGenDesigner.get_metadata(PROPERTY_DOUBLE);
         BOOST_CHECK( NULL != dynamic_cast<const DoubleEditor*>(pEditor) );
 }
 
 BOOST_AUTO_TEST_CASE( TestPropertyGroupWrapper_Float )
 {
         TestPropertyGroup_4 baseObject;
- property_group_Wrapper wrapper("BOOST_AUTO_TEST_CASE", &baseObject);
+ property_group_wrapper wrapper("test_wrapper", &baseObject);
         const Editor *pEditor;
 
         // Test Standard Creation
- wrapper.AddProperty<float>(PROPERTY_FLOAT_1, "PropertyFloat1 description", boost::bind(&TestPropertyGroup_4::SetFloat, &baseObject, _1), boost::bind(&TestPropertyGroup_4::GetFloat, &baseObject), new FloatEditor() );
+ wrapper.add_property<float>(PROPERTY_FLOAT_1, "PropertyFloat1 description", boost::bind(&TestPropertyGroup_4::SetFloat, &baseObject, _1), boost::bind(&TestPropertyGroup_4::GetFloat, &baseObject), new FloatEditor() );
 
         float fValue;
- wrapper.testGroup.set_as_string( PROPERTY_FLOAT_1, PROPERTY_FLOAT_1_STRING_VALUE );
- BOOST_CHECK( from_string<float>(fValue, wrapper.testGroup.get_as_string(PROPERTY_FLOAT_1), std::dec) );
- CHECK_CLOSE( fValue, PROPERTY_FLOAT_1_VALUE, 0.01 );
+ wrapper.set_as_string( PROPERTY_FLOAT_1, PROPERTY_FLOAT_1_STRING_VALUE );
+ BOOST_CHECK( from_string<float>(fValue, wrapper.get_as_string(PROPERTY_FLOAT_1), std::dec) );
+ BOOST_CHECK_EQUAL( fValue, PROPERTY_FLOAT_1_VALUE );
 
- pEditor = wrapper.testGroup.get_metadata( PROPERTY_FLOAT_1 );
+ pEditor = wrapper.get_metadata( PROPERTY_FLOAT_1 );
         BOOST_CHECK( pEditor->getEditorPropertyType() == FloatType );
         BOOST_CHECK( pEditor->GetControlType() == EditBox );
 
         // Test Auto-Generated Designer Creation
- property_group_Wrapper wrapperAutoGenDesigner("BOOST_AUTO_TEST_CASE", &baseObject);
+ property_group_wrapper wrapperAutoGenDesigner("test_wrapper", &baseObject);
 
- wrapperAutoGenDesigner.AddProperty<float>(PROPERTY_FLOAT_1, "PropertyFloat1 description", boost::bind(&TestPropertyGroup_4::SetFloat, &baseObject, _1), boost::bind(&TestPropertyGroup_4::GetFloat, &baseObject) );
+ wrapperAutoGenDesigner.add_property<float>(PROPERTY_FLOAT_1, "PropertyFloat1 description", boost::bind(&TestPropertyGroup_4::SetFloat, &baseObject, _1), boost::bind(&TestPropertyGroup_4::GetFloat, &baseObject) );
 
- pEditor = wrapperAutoGenDesigner.testGroup.get_metadata(PROPERTY_FLOAT_1);
+ pEditor = wrapperAutoGenDesigner.get_metadata(PROPERTY_FLOAT_1);
         BOOST_CHECK( NULL != dynamic_cast<const FloatEditor*>(pEditor) );
 }
 
 BOOST_AUTO_TEST_CASE( TestPropertyGroupWrapper_Integer )
 {
         TestPropertyGroup_4 baseObject;
- property_group_Wrapper wrapper("BOOST_AUTO_TEST_CASE", &baseObject);
+ property_group_wrapper wrapper("test_wrapper", &baseObject);
         const Editor *pEditor;
 
         // Test Standard Creation
- wrapper.AddProperty<int>(PROPERTY_INT_1, "PropertyInt1 description", boost::bind(&TestPropertyGroup_4::SetInt, &baseObject, _1), boost::bind(&TestPropertyGroup_4::GetInt, &baseObject), new IntegerEditor(INT_LOW, INT_HIGH, INT_INCREMENT, DropDown));
+ wrapper.add_property<int>(PROPERTY_INT_1, "PropertyInt1 description", boost::bind(&TestPropertyGroup_4::SetInt, &baseObject, _1), boost::bind(&TestPropertyGroup_4::GetInt, &baseObject), new IntegerEditor(INT_LOW, INT_HIGH, INT_INCREMENT, DropDown));
 
         int iValue;
- wrapper.testGroup.set_as_string( PROPERTY_INT_1, PROPERTY_INT_1_STRING_VALUE );
- BOOST_CHECK( from_string<int>(iValue, wrapper.testGroup.get_as_string(PROPERTY_INT_1), std::dec) );
+ wrapper.set_as_string( PROPERTY_INT_1, PROPERTY_INT_1_STRING_VALUE );
+ BOOST_CHECK( from_string<int>(iValue, wrapper.get_as_string(PROPERTY_INT_1), std::dec) );
         BOOST_CHECK_EQUAL( iValue, PROPERTY_INT_1_VALUE );
 
- pEditor = wrapper.testGroup.get_metadata( PROPERTY_INT_1 );
+ pEditor = wrapper.get_metadata( PROPERTY_INT_1 );
         BOOST_CHECK( pEditor->getEditorPropertyType() == IntegerType );
         BOOST_CHECK( pEditor->GetControlType() == DropDown );
 
         // Test Auto-Generated Designer Creation
- property_group_Wrapper wrapperAutoGenDesigner("BOOST_AUTO_TEST_CASE", &baseObject);
+ property_group_wrapper wrapperAutoGenDesigner("test_wrapper", &baseObject);
 
- wrapperAutoGenDesigner.AddProperty<int>(PROPERTY_INT_1, "PropertyInt1 description", boost::bind(&TestPropertyGroup_4::SetInt, &baseObject, _1), boost::bind(&TestPropertyGroup_4::GetInt, &baseObject) );
+ wrapperAutoGenDesigner.add_property<int>(PROPERTY_INT_1, "PropertyInt1 description", boost::bind(&TestPropertyGroup_4::SetInt, &baseObject, _1), boost::bind(&TestPropertyGroup_4::GetInt, &baseObject) );
 
- pEditor = wrapperAutoGenDesigner.testGroup.get_metadata(PROPERTY_INT_1);
+ pEditor = wrapperAutoGenDesigner.get_metadata(PROPERTY_INT_1);
         BOOST_CHECK( NULL != dynamic_cast<const IntegerEditor*>(pEditor) );
 }
 
 BOOST_AUTO_TEST_CASE( TestPropertyGroupWrapper_String )
 {
         TestPropertyGroup baseObject;
- property_group_Wrapper wrapper("BOOST_AUTO_TEST_CASE", &baseObject);
+ property_group_wrapper wrapper("test_wrapper", &baseObject);
         const Editor *pEditor;
 
         // Test Standard Creation
- wrapper.AddProperty<string>(PROPERTY_STRING_2, "PropertyString2 description", boost::bind(&TestPropertyGroup::SetPropertyString2, &baseObject, _1), boost::bind(&TestPropertyGroup::GetPropertyString2, &baseObject), new StringEditor());
+ wrapper.add_property<string>(PROPERTY_STRING_2, "PropertyString2 description", boost::bind(&TestPropertyGroup::SetPropertyString2, &baseObject, _1), boost::bind(&TestPropertyGroup::GetPropertyString2, &baseObject), new StringEditor());
 
- wrapper.testGroup.set_as_string( PROPERTY_STRING_2, PROPERTY_STRING_2_VALUE );
- BOOST_CHECK( PROPERTY_STRING_2_VALUE == wrapper.testGroup.get_as_string( PROPERTY_STRING_2) );
- wrapper.testGroup.set_as_string( PROPERTY_STRING_2, PROPERTY_STRING_1_VALUE );
- BOOST_CHECK( PROPERTY_STRING_1_VALUE == wrapper.testGroup.get_as_string( PROPERTY_STRING_2) );
+ wrapper.set_as_string( PROPERTY_STRING_2, PROPERTY_STRING_2_VALUE );
+ BOOST_CHECK( PROPERTY_STRING_2_VALUE == wrapper.get_as_string( PROPERTY_STRING_2) );
+ wrapper.set_as_string( PROPERTY_STRING_2, PROPERTY_STRING_1_VALUE );
+ BOOST_CHECK( PROPERTY_STRING_1_VALUE == wrapper.get_as_string( PROPERTY_STRING_2) );
 
- pEditor = wrapper.testGroup.get_metadata( PROPERTY_STRING_2 );
+ pEditor = wrapper.get_metadata( PROPERTY_STRING_2 );
         BOOST_CHECK( pEditor->getEditorPropertyType() == StringType );
         BOOST_CHECK( pEditor->GetControlType() == EditBox );
 
         // Test Auto-Generated Designer Creation
- property_group_Wrapper wrapperAutoGenDesigner("BOOST_AUTO_TEST_CASE", &baseObject);
+ property_group_wrapper wrapperAutoGenDesigner("test_wrapper", &baseObject);
 
- wrapperAutoGenDesigner.AddProperty<string>(PROPERTY_STRING_2, "PropertyString2 description", boost::bind(&TestPropertyGroup::SetPropertyString2, &baseObject, _1), boost::bind(&TestPropertyGroup::GetPropertyString2, &baseObject) );
+ wrapperAutoGenDesigner.add_property<string>(PROPERTY_STRING_2, "PropertyString2 description", boost::bind(&TestPropertyGroup::SetPropertyString2, &baseObject, _1), boost::bind(&TestPropertyGroup::GetPropertyString2, &baseObject) );
 
- pEditor = wrapperAutoGenDesigner.testGroup.get_metadata(PROPERTY_STRING_2);
+ pEditor = wrapperAutoGenDesigner.get_metadata(PROPERTY_STRING_2);
         BOOST_CHECK( NULL != dynamic_cast<const StringEditor*>(pEditor) );
 }
\ No newline at end of file

Modified: sandbox/pinhole/libs/pinhole/test/TestPropertyGroups.cpp
==============================================================================
--- sandbox/pinhole/libs/pinhole/test/TestPropertyGroups.cpp (original)
+++ sandbox/pinhole/libs/pinhole/test/TestPropertyGroups.cpp 2007-08-02 21:45:48 EDT (Thu, 02 Aug 2007)
@@ -21,22 +21,14 @@
 public:
         TestPropertyManager() : property_manager()
         {
- if( NULL != property_manager::m_instance.get() )
- {
- property_manager::delete_instance();
- }
- property_manager::m_instance.reset( this );
-
+ property_manager::m_instance.reset( this );
+
                 uiChildCount = 0;
                 uiSelectSingleNodeCallCount = 0;
                 uiRegisterPropertyGroupCallCount = 0;
                 uiUnRegisterPropertyGroupCallCount = 0;
                 uiAddCategoryCallCount = 0;
         }
- ~TestPropertyManager()
- {
- property_manager::m_instance.reset();
- }
         virtual property_group* select_single_node(property_group* pCurrentPropertyGroup, const string& xpath)
         {
                 ++uiSelectSingleNodeCallCount;
@@ -52,7 +44,7 @@
                         ++uiChildCount;
                 }
         }
- virtual void UnRegisterPropertyGroup( property_group *pPropertyGroup )
+ virtual void unregister_property_group( property_group *pPropertyGroup, category_collection &categories )
         {
                 ++uiUnRegisterPropertyGroupCallCount;
 
@@ -73,6 +65,24 @@
         unsigned int uiAddCategoryCallCount;
 };
 
+class TestPropertyManagerGuard
+{
+ public:
+ TestPropertyManagerGuard()
+ {
+ property_manager::delete_instance();
+
+ p_manager = new TestPropertyManager();
+ }
+
+ ~TestPropertyManagerGuard()
+ {
+ property_manager::delete_instance();
+ }
+
+ TestPropertyManager *p_manager;
+};
+
 BOOST_AUTO_TEST_CASE( TestPropertyParent )
 {
         TestPropertyGroup testGroup;
@@ -153,70 +163,73 @@
 
 BOOST_AUTO_TEST_CASE( TestSingletonPropertyManager )
 {
- TestPropertyManager manager;
+ TestPropertyManagerGuard gaurd;
+ TestPropertyManager *p_manager = gaurd.p_manager;
 
- BOOST_CHECK( property_manager::instance() == &manager );
+ BOOST_CHECK( property_manager::instance() == p_manager );
 }
 
 BOOST_AUTO_TEST_CASE( TestSetParent )
 {
- TestPropertyManager manager;
+ TestPropertyManagerGuard gaurd;
+ TestPropertyManager *p_manager = gaurd.p_manager;
 
         // The first item should parent to root
         TestPropertyChildGroup_1 rootGroup(NULL);
- BOOST_CHECK_EQUAL( manager.uiRegisterPropertyGroupCallCount, 1u );
- BOOST_CHECK_EQUAL( manager.uiUnRegisterPropertyGroupCallCount, 0u );
- BOOST_CHECK_EQUAL( manager.uiChildCount, 1u );
+ BOOST_CHECK_EQUAL( p_manager->uiRegisterPropertyGroupCallCount, 1u );
+ BOOST_CHECK_EQUAL( p_manager->uiUnRegisterPropertyGroupCallCount, 0u );
+ BOOST_CHECK_EQUAL( p_manager->uiChildCount, 1u );
 
         // The second item should parent to the first
         TestPropertyChildGroup_1 childGroup(&rootGroup);
- BOOST_CHECK_EQUAL( manager.uiRegisterPropertyGroupCallCount, 2u );
- BOOST_CHECK_EQUAL( manager.uiUnRegisterPropertyGroupCallCount, 0u );
- BOOST_CHECK_EQUAL( manager.uiChildCount, 1u );
+ BOOST_CHECK_EQUAL( p_manager->uiRegisterPropertyGroupCallCount, 2u );
+ BOOST_CHECK_EQUAL( p_manager->uiUnRegisterPropertyGroupCallCount, 0u );
+ BOOST_CHECK_EQUAL( p_manager->uiChildCount, 1u );
         BOOST_CHECK_EQUAL( rootGroup.get_children_collection().size(), 1u );
         BOOST_CHECK( &rootGroup == childGroup.get_parent() );
 
         // Reparent child to root
         childGroup.set_parent(NULL);
- BOOST_CHECK_EQUAL( manager.uiRegisterPropertyGroupCallCount, 3u );
- BOOST_CHECK_EQUAL( manager.uiUnRegisterPropertyGroupCallCount, 1u );
- BOOST_CHECK_EQUAL( manager.uiChildCount, 2u );
+ BOOST_CHECK_EQUAL( p_manager->uiRegisterPropertyGroupCallCount, 3u );
+ BOOST_CHECK_EQUAL( p_manager->uiUnRegisterPropertyGroupCallCount, 1u );
+ BOOST_CHECK_EQUAL( p_manager->uiChildCount, 2u );
         BOOST_CHECK_EQUAL( rootGroup.get_children_collection().size(), 0u );
         BOOST_CHECK( NULL == childGroup.get_parent() );
 
         // Reparent child to rootGroup
         childGroup.set_parent(&rootGroup);
- BOOST_CHECK_EQUAL( manager.uiRegisterPropertyGroupCallCount, 4u );
- BOOST_CHECK_EQUAL( manager.uiUnRegisterPropertyGroupCallCount, 2u );
- BOOST_CHECK_EQUAL( manager.uiChildCount, 1u );
+ BOOST_CHECK_EQUAL( p_manager->uiRegisterPropertyGroupCallCount, 4u );
+ BOOST_CHECK_EQUAL( p_manager->uiUnRegisterPropertyGroupCallCount, 2u );
+ BOOST_CHECK_EQUAL( p_manager->uiChildCount, 1u );
         BOOST_CHECK_EQUAL( rootGroup.get_children_collection().size(), 1u );
         BOOST_CHECK( &rootGroup == childGroup.get_parent() );
 }
 
 BOOST_AUTO_TEST_CASE( TestAutoReparentToRootInDestructor )
 {
- TestPropertyManager manager;
+ TestPropertyManagerGuard gaurd;
+ TestPropertyManager *p_manager = gaurd.p_manager;
 
         // The first item should parent to root
         TestPropertyChildGroup_1 *pRootGroup = new TestPropertyChildGroup_1(NULL);
- BOOST_CHECK_EQUAL( manager.uiRegisterPropertyGroupCallCount, 1u );
- BOOST_CHECK_EQUAL( manager.uiUnRegisterPropertyGroupCallCount, 0u );
- BOOST_CHECK_EQUAL( manager.uiChildCount, 1u );
+ BOOST_CHECK_EQUAL( p_manager->uiRegisterPropertyGroupCallCount, 1u );
+ BOOST_CHECK_EQUAL( p_manager->uiUnRegisterPropertyGroupCallCount, 0u );
+ BOOST_CHECK_EQUAL( p_manager->uiChildCount, 1u );
 
         // The second item should parent to the first
         TestPropertyChildGroup_1 childGroup(pRootGroup);
- BOOST_CHECK_EQUAL( manager.uiRegisterPropertyGroupCallCount, 2u );
- BOOST_CHECK_EQUAL( manager.uiUnRegisterPropertyGroupCallCount, 0u );
- BOOST_CHECK_EQUAL( manager.uiChildCount, 1u );
+ BOOST_CHECK_EQUAL( p_manager->uiRegisterPropertyGroupCallCount, 2u );
+ BOOST_CHECK_EQUAL( p_manager->uiUnRegisterPropertyGroupCallCount, 0u );
+ BOOST_CHECK_EQUAL( p_manager->uiChildCount, 1u );
         BOOST_CHECK_EQUAL( pRootGroup->get_children_collection().size(), 1u );
         BOOST_CHECK( pRootGroup == childGroup.get_parent() );
 
         // Delete rootGroup.
         // This should cause childGroup to be reparented to root.
         delete pRootGroup;
- BOOST_CHECK_EQUAL( manager.uiRegisterPropertyGroupCallCount, 3u );
- BOOST_CHECK_EQUAL( manager.uiUnRegisterPropertyGroupCallCount, 2u );
- BOOST_CHECK_EQUAL( manager.uiChildCount, 1u );
+ BOOST_CHECK_EQUAL( p_manager->uiRegisterPropertyGroupCallCount, 3u );
+ BOOST_CHECK_EQUAL( p_manager->uiUnRegisterPropertyGroupCallCount, 2u );
+ BOOST_CHECK_EQUAL( p_manager->uiChildCount, 1u );
         BOOST_CHECK( NULL == childGroup.get_parent() );
 }
 
@@ -278,7 +291,7 @@
         TestPropertyChildGroup_1 copiedGroup(&group);
 
         BOOST_CHECK_EQUAL( copiedGroup.get_name().compare(PROPERTY_GROUP_CHILD_NAME), 0 );
- BOOST_CHECK( &testGroup == copiedGroup.get_parent() );
+ BOOST_CHECK( &group == copiedGroup.get_parent() );
 }
 
 BOOST_AUTO_TEST_CASE( TestIsReadOnly )


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