Move DevelHandle::GetCurrentProperty to public
[platform/core/uifw/dali-core.git] / automated-tests / src / dali / utc-Dali-Constrainer.cpp
index e212720..9bea015 100644 (file)
@@ -20,7 +20,6 @@
 #include <stdlib.h>
 #include <dali/public-api/dali-core.h>
 #include <dali/devel-api/animation/path-constrainer.h>
-#include <dali/devel-api/object/handle-devel.h>
 #include <dali-test-suite-utils.h>
 
 using namespace Dali;
@@ -189,14 +188,14 @@ int UtcPathConstrainerApplyRange(void)
 
   Vector3 position, tangent;
   float tValue;
-  actor.GetProperty(index).Get(tValue);
+  actor.GetCurrentProperty( index ).Get(tValue);
   float currentCursor =  ( tValue - range.x ) / (range.y-range.x);
   path.Sample(currentCursor, position, tangent );
   DALI_TEST_EQUALS( actor.GetCurrentPosition(), position, TEST_LOCATION );
 
   application.SendNotification();
   application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 50% progress */);
-  actor.GetProperty(index).Get(tValue);
+  actor.GetCurrentProperty( index ).Get(tValue);
   currentCursor =  ( tValue - range.x ) / (range.y-range.x);
   path.Sample(currentCursor, position, tangent );
   path.Sample(0.5, position, tangent );
@@ -204,21 +203,27 @@ int UtcPathConstrainerApplyRange(void)
 
   application.SendNotification();
   application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 75% progress */);
-  DevelHandle::GetCurrentProperty( actor, index ).Get( tValue );
+  actor.GetCurrentProperty( index ).Get( tValue );
   currentCursor =  ( tValue - range.x ) / (range.y-range.x);
   path.Sample(currentCursor, position, tangent );
   DALI_TEST_EQUALS( actor.GetCurrentPosition(), position, TEST_LOCATION );
 
   application.SendNotification();
   application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 100% progress */);
-  DevelHandle::GetCurrentProperty( actor, index ).Get( tValue );
+  actor.GetCurrentProperty( index ).Get( tValue );
   currentCursor =  ( tValue - range.x ) / (range.y-range.x);
   path.Sample(currentCursor, position, tangent );
   DALI_TEST_EQUALS( actor.GetCurrentPosition(), position, TEST_LOCATION );
 
   application.SendNotification();
   application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* beyond the animation duration*/);
-  DevelHandle::GetCurrentProperty( actor, index ).Get( tValue );
+  actor.GetCurrentProperty( index ).Get( tValue );
+  currentCursor =  ( tValue - range.x ) / (range.y-range.x);
+  path.Sample(currentCursor, position, tangent );
+  DALI_TEST_EQUALS( actor.GetCurrentPosition(), position, TEST_LOCATION );
+
+  // Ensure GetProperty also returns the final result
+  actor.GetProperty( index ).Get( tValue );
   currentCursor =  ( tValue - range.x ) / (range.y-range.x);
   path.Sample(currentCursor, position, tangent );
   DALI_TEST_EQUALS( actor.GetCurrentPosition(), position, TEST_LOCATION );
@@ -319,7 +324,7 @@ int UtcPathConstrainerProperties(void)
 
   pathConstrainer.SetProperty( Dali::PathConstrainer::Property::FORWARD, Vector3( 1.0f,0.0f,0.0f ) );
   DALI_TEST_EQUALS( pathConstrainer.GetProperty< Vector3 >( Dali::PathConstrainer::Property::FORWARD ), Vector3( 1.0f, 0.0f, 0.0f ), TEST_LOCATION );
-  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< Vector3 >( pathConstrainer, Dali::PathConstrainer::Property::FORWARD ), Vector3( 1.0f, 0.0f, 0.0f ), TEST_LOCATION );
+  DALI_TEST_EQUALS( pathConstrainer.GetCurrentProperty< Vector3 >( Dali::PathConstrainer::Property::FORWARD ), Vector3( 1.0f, 0.0f, 0.0f ), TEST_LOCATION );
 
   Dali::Property::Array points;
   points.Resize(3);
@@ -341,7 +346,7 @@ int UtcPathConstrainerProperties(void)
   }
 
   {
-    Property::Value value = DevelHandle::GetCurrentProperty( pathConstrainer, Dali::PathConstrainer::Property::POINTS );
+    Property::Value value = pathConstrainer.GetCurrentProperty( Dali::PathConstrainer::Property::POINTS );
     Property::Array* array = value.GetArray();
     DALI_TEST_CHECK( array );
 
@@ -372,7 +377,7 @@ int UtcPathConstrainerProperties(void)
   }
 
   {
-    Property::Value value = DevelHandle::GetCurrentProperty( pathConstrainer, Dali::PathConstrainer::Property::CONTROL_POINTS );
+    Property::Value value = pathConstrainer.GetCurrentProperty( Dali::PathConstrainer::Property::CONTROL_POINTS );
     Property::Array* array = value.GetArray();
     DALI_TEST_CHECK( array );
 
@@ -646,7 +651,7 @@ int UtcLinearConstrainerProperties(void)
   }
 
   {
-    Property::Value value = DevelHandle::GetCurrentProperty( linearConstrainer, Dali::LinearConstrainer::Property::VALUE );
+    Property::Value value = linearConstrainer.GetCurrentProperty( Dali::LinearConstrainer::Property::VALUE );
     Property::Array* array = value.GetArray();
     DALI_TEST_CHECK( array );
 
@@ -675,7 +680,7 @@ int UtcLinearConstrainerProperties(void)
   }
 
   {
-    Property::Value value = DevelHandle::GetCurrentProperty( linearConstrainer, Dali::LinearConstrainer::Property::PROGRESS );
+    Property::Value value = linearConstrainer.GetCurrentProperty( Dali::LinearConstrainer::Property::PROGRESS );
     Property::Array* array = value.GetArray();
     DALI_TEST_CHECK( array );