Merge "SVACE issue resolved" into devel/master
[platform/core/uifw/dali-core.git] / automated-tests / src / dali / utc-Dali-Constrainer.cpp
index d98db91..c810b9b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
 #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;
@@ -203,21 +204,21 @@ int UtcPathConstrainerApplyRange(void)
 
   application.SendNotification();
   application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 75% progress */);
-  actor.GetProperty(index).Get(tValue);
+  DevelHandle::GetCurrentProperty( actor, 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 */);
-  actor.GetProperty(index).Get(tValue);
+  DevelHandle::GetCurrentProperty( actor, 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*/);
-  actor.GetProperty(index).Get(tValue);
+  DevelHandle::GetCurrentProperty( actor, index ).Get( tValue );
   currentCursor =  ( tValue - range.x ) / (range.y-range.x);
   path.Sample(currentCursor, position, tangent );
   DALI_TEST_EQUALS( actor.GetCurrentPosition(), position, TEST_LOCATION );
@@ -312,6 +313,38 @@ int UtcPathConstrainerRemove(void)
 }
 
 //LinearConstrainer test cases
+int UtcLinearConstrainerDownCast(void)
+{
+  TestApplication application;
+  Dali::LinearConstrainer linearConstrainer = Dali::LinearConstrainer::New();
+
+  BaseHandle handle( linearConstrainer );
+  Dali::LinearConstrainer linearConstrainer2 = Dali::LinearConstrainer::DownCast( handle );
+  DALI_TEST_EQUALS( (bool)linearConstrainer2, true, TEST_LOCATION );
+
+  BaseHandle handle2;
+  Dali:: LinearConstrainer linearConstrainer3 = Dali::LinearConstrainer::DownCast( handle2 );
+  DALI_TEST_EQUALS( (bool)linearConstrainer3, false, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcLinearConstrainerCopyConstructor(void)
+{
+  TestApplication application;
+  Dali::LinearConstrainer linearConstrainer;
+  DALI_TEST_EQUALS( (bool)linearConstrainer, false, TEST_LOCATION );
+
+  linearConstrainer = Dali::LinearConstrainer::New();
+  DALI_TEST_EQUALS( (bool)linearConstrainer, true, TEST_LOCATION );
+
+  // call the copy constructor
+  Dali::LinearConstrainer linearConstrainer2( linearConstrainer );
+  DALI_TEST_EQUALS( (bool)linearConstrainer2, true, TEST_LOCATION );
+
+  END_TEST;
+}
+
 int UtcLinearConstrainerApply(void)
 {
   TestApplication application;