From fac3b2cf0d890b974d81b6bb33a5b3826db964c8 Mon Sep 17 00:00:00 2001 From: "dongsug.song" Date: Tue, 15 Nov 2016 09:21:28 +0900 Subject: [PATCH] Revert "[3.0] Adding ObjectDestructionTracker to dali-test-suite-utils for testing object destruction" This reverts commit 182b768f4104caba71be2364bd728b83740a67e5. Change-Id: Ied748a39150f62f40326e481627e5cf1d211f05f --- .../dali-test-suite-utils.cpp | 48 ---------------------- .../dali-test-suite-utils/dali-test-suite-utils.h | 41 ------------------ 2 files changed, 89 deletions(-) diff --git a/automated-tests/src/dali-adaptor/dali-test-suite-utils/dali-test-suite-utils.cpp b/automated-tests/src/dali-adaptor/dali-test-suite-utils/dali-test-suite-utils.cpp index b50f506..467bb52 100644 --- a/automated-tests/src/dali-adaptor/dali-test-suite-utils/dali-test-suite-utils.cpp +++ b/automated-tests/src/dali-adaptor/dali-test-suite-utils/dali-test-suite-utils.cpp @@ -337,51 +337,3 @@ BufferImage CreateBufferImage() { return CreateBufferImage(4, 4, Color::WHITE); } - -namespace Test -{ - -struct ObjectDestructionFunctor -{ - // Create a ObjectDestructionFunctor passing in a Dali::RefObject* to be monitored and a bool variable. - // Create ObjectRegistry instance and connect to the ObjectDestroyedSignal passing in the above functor for the callback. - // Get the ObjectPointer (Actor::GetObjectPtr) of the Actor to be checked for destruction and assign it to the Dali::RefObject* - // Check the bool variable which would be true when object destroyed. - ObjectDestructionFunctor( Dali::RefObject* objectPtr, bool& refObjectDestroyed ) - : refObjectPointerToCheck( objectPtr ), - refObjectDestroyedBoolean( refObjectDestroyed ) - { - refObjectDestroyed = false; - } - - void operator()( const Dali::RefObject* objectPointer ) - { - if ( refObjectPointerToCheck == objectPointer ) - { - refObjectDestroyedBoolean = true; - } - } - - Dali::RefObject* refObjectPointerToCheck; - bool& refObjectDestroyedBoolean; -}; - -ObjectDestructionTracker::ObjectDestructionTracker() - :mRefObjectDestroyed( false) -{ -} - -void ObjectDestructionTracker::Start( Actor actor ) -{ - ObjectDestructionFunctor destructionFunctor( actor.GetObjectPtr(), mRefObjectDestroyed ); - - ObjectRegistry objectRegistry = Stage::GetCurrent().GetObjectRegistry(); - objectRegistry.ObjectDestroyedSignal().Connect( this, destructionFunctor ); -} - -bool ObjectDestructionTracker::IsDestroyed() -{ - return mRefObjectDestroyed; -} - -} // namespace Test diff --git a/automated-tests/src/dali-adaptor/dali-test-suite-utils/dali-test-suite-utils.h b/automated-tests/src/dali-adaptor/dali-test-suite-utils/dali-test-suite-utils.h index 8cefb7c..7f81872 100644 --- a/automated-tests/src/dali-adaptor/dali-test-suite-utils/dali-test-suite-utils.h +++ b/automated-tests/src/dali-adaptor/dali-test-suite-utils/dali-test-suite-utils.h @@ -499,45 +499,4 @@ struct DefaultFunctionCoverage BufferImage CreateBufferImage(); BufferImage CreateBufferImage(int width, int height, const Vector4& color); -// Test namespace to prevent pollution of Dali namespace, add Test helper functions here -namespace Test -{ -/** - * @brief - * - * Helper to check object destruction occurred - * 1) In main part of code create an ObjectDestructionTracker - * 2) Within sub section of main create object Actor test and call Start with Actor to test for destruction - * 3) Perform code which is expected to destroy Actor - * 4) Back in main part of code use IsDestroyed() to test if Actor was destroyed - */ -class ObjectDestructionTracker : public ConnectionTracker -{ -public: - - /** - * @brief Call in main part of code - */ - ObjectDestructionTracker(); - - /** - * @brief Call in sub bock of code where the Actor being checked is still alive. - * - * @param[in] actor Actor to be checked for destruction - */ - void Start( Actor actor ); - - /** - * @brief Call to check if Actor alive or destroyed. - * - * @return bool true if Actor was destroyed - */ - bool IsDestroyed(); - -private: - bool mRefObjectDestroyed; -}; - -} // namespace Test - #endif // __DALI_TEST_SUITE_UTILS_H__ -- 2.7.4