Add extension to PropertyInput
[platform/core/uifw/dali-core.git] / automated-tests / src / dali / utc-Dali-ActiveConstraint.cpp
index 7327533..0c765bd 100644 (file)
@@ -1,22 +1,23 @@
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Flora License, Version 1.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://floralicense.org/license/
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an AS IS BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
+/*
+ * Copyright (c) 2014 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 #include <iostream>
 #include <stdlib.h>
-#include <dali/dali.h>
+#include <dali/public-api/dali-core.h>
 #include <dali-test-suite-utils.h>
 
 using namespace Dali;
@@ -58,7 +59,7 @@ int UtcDaliConstraintGetTargetObject(void)
 
   // Apply a constraint to an actor
 
-  Constraint constraint = Constraint::New<Vector3>( Actor::SIZE, TestConstraintVector3() );
+  Constraint constraint = Constraint::New<Vector3>( Actor::Property::SIZE, TestConstraintVector3() );
 
   Actor actor = Actor::New();
 
@@ -89,7 +90,7 @@ int UtcDaliConstraintGetTargetProperty(void)
 
   // Apply a constraint to an actor
 
-  Constraint constraint = Constraint::New<Vector3>( Actor::SIZE, TestConstraintVector3() );
+  Constraint constraint = Constraint::New<Vector3>( Actor::Property::SIZE, TestConstraintVector3() );
 
   Actor actor = Actor::New();
 
@@ -99,7 +100,7 @@ int UtcDaliConstraintGetTargetProperty(void)
 
   Property::Index index = active.GetTargetProperty();
 
-  DALI_TEST_CHECK( Actor::SIZE == index );
+  DALI_TEST_CHECK( Actor::Property::SIZE == index );
   END_TEST;
 }
 
@@ -109,7 +110,7 @@ int UtcDaliConstraintSetWeight(void)
 
   // Apply a constraint to an actor
 
-  Constraint constraint = Constraint::New<Vector3>( Actor::SIZE, TestConstraintVector3() );
+  Constraint constraint = Constraint::New<Vector3>( Actor::Property::SIZE, TestConstraintVector3() );
 
   Actor actor = Actor::New();
   Stage::GetCurrent().Add( actor );
@@ -157,7 +158,7 @@ int UtcDaliConstraintGetCurrentWeight(void)
 
   // Apply a constraint to an actor
 
-  Constraint constraint = Constraint::New<Vector3>( Actor::SIZE, TestConstraintVector3() );
+  Constraint constraint = Constraint::New<Vector3>( Actor::Property::SIZE, TestConstraintVector3() );
 
   Actor actor = Actor::New();
 
@@ -175,7 +176,7 @@ int UtcDaliConstraintSignalApplied(void)
 
   // Apply a constraint to an actor
 
-  Constraint constraint = Constraint::New<Vector3>( Actor::SIZE, TestConstraintVector3() );
+  Constraint constraint = Constraint::New<Vector3>( Actor::Property::SIZE, TestConstraintVector3() );
 
   float duration( 10.0f );
   constraint.SetApplyTime( duration );
@@ -225,7 +226,7 @@ int UtcDaliConstraintRemove(void)
 
   // Apply a constraint to an actor
 
-  Constraint constraint = Constraint::New<Vector3>( Actor::SIZE, TestConstraintVector3() );
+  Constraint constraint = Constraint::New<Vector3>( Actor::Property::SIZE, TestConstraintVector3() );
 
   float duration( 1.0f );
   constraint.SetApplyTime( duration );
@@ -273,24 +274,17 @@ int UtcDaliConstraintRemove(void)
   DALI_TEST_CHECK( startSize == actor.GetCurrentSize() );
 
   // Try setting the weight after removal
-  active.SetProperty( ActiveConstraint::WEIGHT, 0.5f );
+  active.SetProperty( ActiveConstraint::Property::WEIGHT, 0.5f );
   application.SendNotification();
   application.Render(static_cast<unsigned int>(1000.0f));
   DALI_TEST_CHECK( 0.5f == active.GetCurrentWeight() );
-
-  // Quick check for operator = override on constrainables (needs rhs as a Handle!!) and destructor from heap
-  Constrainable* constrainable = new Constrainable;
-  Constrainable constrainable2;
-  Handle& handle = dynamic_cast< Handle& > ( *constrainable );
-  constrainable2 = handle;
-  delete constrainable;
   END_TEST;
 }
 
 int UtcDaliConstraintCallback(void)
 {
   TestApplication application;
-  Constraint constraint = Constraint::New<Vector3>( Actor::SIZE, TestConstraintVector3() );
+  Constraint constraint = Constraint::New<Vector3>( Actor::Property::SIZE, TestConstraintVector3() );
   constraint.SetApplyTime(2.0f);
   Actor actor = Actor::New();
   ActiveConstraint active = actor.ApplyConstraint( constraint );
@@ -311,7 +305,7 @@ int UtcDaliConstraintProperties(void)
 {
   TestApplication application;
 
-  Constraint constraint = Constraint::New<Vector3>( Actor::SIZE, TestConstraintVector3() );
+  Constraint constraint = Constraint::New<Vector3>( Actor::Property::SIZE, TestConstraintVector3() );
   Actor actor = Actor::New();
   ActiveConstraint active = actor.ApplyConstraint( constraint );