Harmonize Animation API parameter checking and add test cases for them 11/192211/3
authorKimmo Hoikka <kimmo.hoikka@samsung.com>
Wed, 31 Oct 2018 17:18:07 +0000 (17:18 +0000)
committerKimmo Hoikka <kimmo.hoikka@samsung.com>
Thu, 1 Nov 2018 12:28:13 +0000 (12:28 +0000)
Change-Id: I777ab4ec07a2eaae87bb435f8bcd9638557c1945

automated-tests/README.md
automated-tests/src/dali/dali-test-suite-utils/dali-test-suite-utils.h
automated-tests/src/dali/dali-test-suite-utils/test-application.cpp
automated-tests/src/dali/dali-test-suite-utils/test-application.h
automated-tests/src/dali/utc-Dali-Animation.cpp
automated-tests/src/dali/utc-Dali-Handle.cpp
dali/internal/event/animation/animation-impl.cpp
dali/internal/event/animation/animation-impl.h
dali/internal/event/animation/key-frames-impl.cpp
dali/internal/event/common/object-impl.cpp

index 8beb8b0..454a431 100644 (file)
@@ -177,7 +177,6 @@ If you are adding test cases to existing files, then all you need to do is creat
       END_TEST;
     }
 
-
 Note that **there must be no extra whitespace in the method signature** (i.e., it must violate our coding convention and follow __exactly__ this pattern: `int UtcDaliMyTestcaseName(void)`), as it's parsed by an awk script to auto-generate the testcase arrays in the main header file.
 
 You can contine to use the TET api, e.g. `tet_infoline`, `tet_result` and our test check methods `DALI_TEST_CHECK`, `DALI_TEST_EQUALS`, etc.
@@ -187,6 +186,41 @@ If you need any non-test methods or variables, ensure they are wrapped in an ano
 If you are adding new test files, then you need to add the filename to the SET(TC_SOURCES...
 section of CMakeLists.txt (this is also parsed by an awk script prior to building)
 
+Good Practices
+--------------
+Use DALI_TEST_EQUALS to test actual value against expected value, like this:
+
+    DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::COLOR_ALPHA ), 0.9f, TEST_LOCATION );
+
+This will speed up debugging in case the test some day fails. There is also a variant to test that value is greater than expected:
+
+    DALI_TEST_GREATER( textureBindIndex[1], textureBindIndex[2], TEST_LOCATION );
+
+When doing negative tests where your code uses DALI_ASSERT_ALWAYS, use the DALI_TEST_ASSERTION macro, like below:
+
+    DALI_TEST_ASSERTION(
+    {
+        animation.AnimateTo( Property( actor, Actor::Property::PARENT_ORIGIN ), targetParentOrigin );
+    }, "IsPropertyAnimatable( index )" );
+
+This macro will catch the DALi Exception and check that the correct assert message was included. It will also fail the test in case the assert did not occur. It also reduces the amount of false positive error logging whilst the  is being thrown making it easier to see the real errors.
+
+Note, DALI_ASSERT_DEBUG cannot be tested as tests execute against release version of the code.
+
+Use additional scope to control the life of stack allocated objects, such as DALi handles
+
+    // try reparenting an orphaned child
+    {
+        Actor temporaryParent = Actor::New();
+        temporaryParent.Add( child );
+        DALI_TEST_EQUALS( parent2.GetChildCount(), 0u, TEST_LOCATION );
+    }
+    // temporaryParent has now died, reparent the orphaned child
+    parent2.Add( child );
+    DALI_TEST_EQUALS( parent2.GetChildCount(), 1u, TEST_LOCATION );
+
+Always test the output of your test by making your code fail!!!
+
 Debugging
 =========
 
index ed1a65f..70f4254 100644 (file)
@@ -344,6 +344,27 @@ inline void DALI_TEST_PRINT_ASSERT( DaliException& e )
   tet_printf("Assertion %s failed at %s\n", e.condition, e.location );
 }
 
+/**
+ * Test that given piece of code triggers the right assertion
+ * Fails the test if the assert didn't occur.
+ * Turns off logging during the execution of the code to avoid excessive false positive log output from the assertions
+ * @param expressions code to execute
+ * @param assertstring the substring expected in the assert
+ */
+#define DALI_TEST_ASSERTION( expressions, assertstring ) \
+try \
+{ \
+  TestApplication::EnableLogging( false ); \
+  expressions; \
+  TestApplication::EnableLogging( true ); \
+  fprintf(stderr, "Test failed in %s, expected assert: '%s' didn't occur\n", __FILELINE__, assertstring ); \
+  tet_result(TET_FAIL); \
+  throw("TET_FAIL"); } \
+catch( Dali::DaliException& e ) \
+{ \
+  DALI_TEST_ASSERT( e, assertstring, TEST_LOCATION ); \
+}
+
 // Functor to test whether an Applied signal is emitted
 struct ConstraintAppliedCheck
 {
index a20ef6d..c953f50 100644 (file)
@@ -20,6 +20,7 @@
 namespace Dali
 {
 
+bool TestApplication::mLoggingEnabled = true;
 
 TestApplication::TestApplication( uint32_t surfaceWidth,
                                   uint32_t surfaceHeight,
@@ -77,30 +78,33 @@ void TestApplication::LogContext( bool start, const char* tag )
 {
   if( start )
   {
-    fprintf(stderr, "INFO: Trace Start: %s", tag);
+    fprintf(stderr, "INFO: Trace Start: %s\n", tag);
   }
   else
   {
-    fprintf(stderr, "INFO: Trace End: %s", tag);
+    fprintf(stderr, "INFO: Trace End: %s\n", tag);
   }
 }
 
 void TestApplication::LogMessage(Dali::Integration::Log::DebugPriority level, std::string& message)
 {
-  switch(level)
+  if( mLoggingEnabled )
   {
-    case Dali::Integration::Log::DebugInfo:
-      fprintf(stderr, "INFO: %s", message.c_str());
-      break;
-    case Dali::Integration::Log::DebugWarning:
-      fprintf(stderr, "WARN: %s", message.c_str());
-      break;
-    case Dali::Integration::Log::DebugError:
-      fprintf(stderr, "ERROR: %s", message.c_str());
-      break;
-    default:
-      fprintf(stderr, "DEFAULT: %s", message.c_str());
-      break;
+    switch(level)
+    {
+      case Dali::Integration::Log::DebugInfo:
+        fprintf(stderr, "INFO: %s", message.c_str());
+        break;
+      case Dali::Integration::Log::DebugWarning:
+        fprintf(stderr, "WARN: %s", message.c_str());
+        break;
+      case Dali::Integration::Log::DebugError:
+        fprintf(stderr, "ERROR: %s", message.c_str());
+        break;
+      default:
+        fprintf(stderr, "DEFAULT: %s", message.c_str());
+        break;
+    }
   }
 }
 
index 49f2b3c..d1e042d 100644 (file)
@@ -78,6 +78,10 @@ public:
   void ResetContext();
   bool GetRenderNeedsUpdate();
   uint32_t Wait( uint32_t durationToWait );
+  static void EnableLogging( bool enabled )
+  {
+    mLoggingEnabled = enabled;
+  }
 
 private:
   void DoUpdate( uint32_t intervalMilliseconds, const char* location=NULL );
@@ -101,6 +105,7 @@ protected:
   struct { uint32_t x; uint32_t y; } mDpi;
   uint32_t mLastVSyncTime;
   ResourcePolicy::DataRetention mDataRetentionPolicy;
+  static bool mLoggingEnabled;
 };
 
 } // Dali
index 66dba1b..83f3bad 100644 (file)
@@ -6696,19 +6696,15 @@ int UtcDaliAnimationAnimateToActorParentOriginP(void)
   Animation animation = Animation::New(durationSeconds);
   Vector3 targetParentOrigin(ParentOrigin::BOTTOM_RIGHT);
 
-  try
+  DALI_TEST_ASSERTION(
   {
     animation.AnimateTo( Property(actor, Actor::Property::PARENT_ORIGIN), targetParentOrigin );
-  }
-  catch (Dali::DaliException& e)
-  {
-    DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_ASSERT(e, "IsPropertyAnimatable( index )", TEST_LOCATION);
-  }
+  }, "IsPropertyAnimatable( index )" );
+
   END_TEST;
 }
 
-int UtcDaliAnimationAnimateToActorParentOriginXP(void)
+int UtcDaliAnimationAnimateToActorParentOriginXN(void)
 {
   TestApplication application;
 
@@ -6723,19 +6719,15 @@ int UtcDaliAnimationAnimateToActorParentOriginXP(void)
   Animation animation = Animation::New(durationSeconds);
   float targetX(1.0f);
 
-  try
+  DALI_TEST_ASSERTION(
   {
     animation.AnimateTo( Property(actor, Actor::Property::PARENT_ORIGIN_X), targetX );
-  }
-  catch (Dali::DaliException& e)
-  {
-    DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_ASSERT(e, "IsPropertyAnimatable( index )", TEST_LOCATION);
-  }
+  }, "IsPropertyAnimatable( index )" );
+
   END_TEST;
 }
 
-int UtcDaliAnimationAnimateToActorParentOriginYP(void)
+int UtcDaliAnimationAnimateToActorParentOriginYN(void)
 {
   TestApplication application;
 
@@ -6750,19 +6742,15 @@ int UtcDaliAnimationAnimateToActorParentOriginYP(void)
   Animation animation = Animation::New(durationSeconds);
   float targetY(1.0f);
 
-  try
+  DALI_TEST_ASSERTION(
   {
     animation.AnimateTo( Property(actor, Actor::Property::PARENT_ORIGIN_Y), targetY );
-  }
-  catch (Dali::DaliException& e)
-  {
-    DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_ASSERT(e, "IsPropertyAnimatable( index )", TEST_LOCATION);
-  }
+  }, "IsPropertyAnimatable( index )" );
+
   END_TEST;
 }
 
-int UtcDaliAnimationAnimateToActorParentOriginZP(void)
+int UtcDaliAnimationAnimateToActorParentOriginZN(void)
 {
   TestApplication application;
 
@@ -6777,19 +6765,15 @@ int UtcDaliAnimationAnimateToActorParentOriginZP(void)
   Animation animation = Animation::New(durationSeconds);
   float targetZ(1.0f);
 
-  try
+  DALI_TEST_ASSERTION(
   {
     animation.AnimateTo( Property(actor, Actor::Property::PARENT_ORIGIN_Z), targetZ );
-  }
-  catch (Dali::DaliException& e)
-  {
-    DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_ASSERT(e, "IsPropertyAnimatable( index )", TEST_LOCATION);
-  }
+  }, "IsPropertyAnimatable( index )" );
+
   END_TEST;
 }
 
-int UtcDaliAnimationAnimateToActorAnchorPointP(void)
+int UtcDaliAnimationAnimateToActorAnchorPointN(void)
 {
   TestApplication application;
 
@@ -6802,19 +6786,15 @@ int UtcDaliAnimationAnimateToActorAnchorPointP(void)
   Animation animation = Animation::New(durationSeconds);
   Vector3 targetAnchorPoint(AnchorPoint::TOP_LEFT);
 
-  try
+  DALI_TEST_ASSERTION(
   {
     animation.AnimateTo( Property(actor, Actor::Property::ANCHOR_POINT), targetAnchorPoint);
-  }
-  catch (Dali::DaliException& e)
-  {
-    DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_ASSERT(e, "IsPropertyAnimatable( index )", TEST_LOCATION);
-  }
+  }, "IsPropertyAnimatable( index )" );
+
   END_TEST;
 }
 
-int UtcDaliAnimationAnimateToActorAnchorPointXP(void)
+int UtcDaliAnimationAnimateToActorAnchorPointXN(void)
 {
   TestApplication application;
 
@@ -6829,19 +6809,15 @@ int UtcDaliAnimationAnimateToActorAnchorPointXP(void)
   Animation animation = Animation::New(durationSeconds);
   float targetX(1.0f);
 
-  try
+  DALI_TEST_ASSERTION(
   {
     animation.AnimateTo( Property(actor, Actor::Property::ANCHOR_POINT_X), targetX );
-  }
-  catch (Dali::DaliException& e)
-  {
-    DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_ASSERT(e, "IsPropertyAnimatable( index )", TEST_LOCATION);
-  }
+  }, "IsPropertyAnimatable( index )" );
+
   END_TEST;
 }
 
-int UtcDaliAnimationAnimateToActorAnchorPointYP(void)
+int UtcDaliAnimationAnimateToActorAnchorPointYN(void)
 {
   TestApplication application;
 
@@ -6856,19 +6832,15 @@ int UtcDaliAnimationAnimateToActorAnchorPointYP(void)
   Animation animation = Animation::New(durationSeconds);
   float targetY(0.0f);
 
-  try
+  DALI_TEST_ASSERTION(
   {
     animation.AnimateTo( Property(actor, Actor::Property::ANCHOR_POINT_Y), targetY );
-  }
-  catch (Dali::DaliException& e)
-  {
-    DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_ASSERT(e, "IsPropertyAnimatable( index )", TEST_LOCATION);
-  }
+  }, "IsPropertyAnimatable( index )" );
+
   END_TEST;
 }
 
-int UtcDaliAnimationAnimateToActorAnchorPointZP(void)
+int UtcDaliAnimationAnimateToActorAnchorPointZN(void)
 {
   TestApplication application;
 
@@ -6883,15 +6855,11 @@ int UtcDaliAnimationAnimateToActorAnchorPointZP(void)
   Animation animation = Animation::New(durationSeconds);
   float targetZ(100.0f);
 
-  try
+  DALI_TEST_ASSERTION(
   {
     animation.AnimateTo( Property(actor, Actor::Property::ANCHOR_POINT_Z), targetZ );
-  }
-  catch (Dali::DaliException& e)
-  {
-    DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_ASSERT(e, "IsPropertyAnimatable( index )", TEST_LOCATION);
-  }
+  }, "IsPropertyAnimatable( index )" );
+
   END_TEST;
 }
 
@@ -8642,7 +8610,7 @@ int UtcDaliAnimationKeyFrames01P(void)
   END_TEST;
 }
 
-int UtcDaliAnimationKeyFrames02P(void)
+int UtcDaliAnimationKeyFrames02N(void)
 {
   TestApplication application;
 
@@ -8658,19 +8626,15 @@ int UtcDaliAnimationKeyFrames02P(void)
 
   DALI_TEST_EQUALS(keyFrames.GetType(), Property::FLOAT, TEST_LOCATION);
 
-  try
+  DALI_TEST_ASSERTION(
   {
     keyFrames.Add(1.9f, false);
-  }
-  catch (Dali::DaliException& e)
-  {
-    DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_ASSERT(e, "mType == value.GetType()", TEST_LOCATION);
-  }
+  }, "mType == value.GetType()" );
+
   END_TEST;
 }
 
-int UtcDaliAnimationKeyFrames03P(void)
+int UtcDaliAnimationKeyFrames03N(void)
 {
   TestApplication application;
 
@@ -8686,19 +8650,15 @@ int UtcDaliAnimationKeyFrames03P(void)
 
   DALI_TEST_EQUALS(keyFrames.GetType(), Property::BOOLEAN, TEST_LOCATION);
 
-  try
+  DALI_TEST_ASSERTION(
   {
     keyFrames.Add(0.7f, Vector3(1.0f, 1.0f, 1.0f));
-  }
-  catch (Dali::DaliException& e)
-  {
-    DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_ASSERT(e, "mType == value.GetType()", TEST_LOCATION);
-  }
+  }, "mType == value.GetType()" );
+
   END_TEST;
 }
 
-int UtcDaliAnimationKeyFrames04P(void)
+int UtcDaliAnimationKeyFrames04N(void)
 {
   TestApplication application;
 
@@ -8714,19 +8674,15 @@ int UtcDaliAnimationKeyFrames04P(void)
 
   DALI_TEST_EQUALS(keyFrames.GetType(), Property::VECTOR2, TEST_LOCATION);
 
-  try
+  DALI_TEST_ASSERTION(
   {
     keyFrames.Add(0.7f, Vector3(1.0f, 1.0f, 1.0f));
-  }
-  catch (Dali::DaliException& e)
-  {
-    DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_ASSERT(e, "mType == value.GetType()", TEST_LOCATION);
-  }
+  }, "mType == value.GetType()" );
+
   END_TEST;
 }
 
-int UtcDaliAnimationKeyFrames05P(void)
+int UtcDaliAnimationKeyFrames05N(void)
 {
   TestApplication application;
 
@@ -8742,19 +8698,15 @@ int UtcDaliAnimationKeyFrames05P(void)
 
   DALI_TEST_EQUALS(keyFrames.GetType(), Property::VECTOR3, TEST_LOCATION);
 
-  try
+  DALI_TEST_ASSERTION(
   {
     keyFrames.Add(0.7f, 1.0f);
-  }
-  catch (Dali::DaliException& e)
-  {
-    DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_ASSERT(e, "mType == value.GetType()", TEST_LOCATION);
-  }
+  }, "mType == value.GetType()" );
+
   END_TEST;
 }
 
-int UtcDaliAnimationKeyFrames06P(void)
+int UtcDaliAnimationKeyFrames06N(void)
 {
   TestApplication application;
 
@@ -8770,19 +8722,15 @@ int UtcDaliAnimationKeyFrames06P(void)
 
   DALI_TEST_EQUALS(keyFrames.GetType(), Property::VECTOR4, TEST_LOCATION);
 
-  try
+  DALI_TEST_ASSERTION(
   {
     keyFrames.Add(0.7f, Quaternion(Radian(1.717f), Vector3::XAXIS));
-  }
-  catch (Dali::DaliException& e)
-  {
-    DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_ASSERT(e, "mType == value.GetType()", TEST_LOCATION);
-  }
+  }, "mType == value.GetType()" );
+
   END_TEST;
 }
 
-int UtcDaliAnimationKeyFrames07P(void)
+int UtcDaliAnimationKeyFrames07N(void)
 {
   TestApplication application;
 
@@ -8798,15 +8746,11 @@ int UtcDaliAnimationKeyFrames07P(void)
 
   DALI_TEST_EQUALS(keyFrames.GetType(), Property::ROTATION, TEST_LOCATION);
 
-  try
+  DALI_TEST_ASSERTION(
   {
     keyFrames.Add(0.7f, 1.1f);
-  }
-  catch (Dali::DaliException& e)
-  {
-    DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_ASSERT(e, "mType == value.GetType()", TEST_LOCATION);
-  }
+  }, "mType == value.GetType()" );
+
   END_TEST;
 }
 
@@ -10709,19 +10653,14 @@ int UtcDaliAnimationAnimateByNonAnimateableTypeN(void)
   Stage::GetCurrent().Add(actor);
   DALI_TEST_EQUALS( actor.GetProperty<int>(index), startValue, TEST_LOCATION );
 
-  try
+  DALI_TEST_ASSERTION(
   {
     // Build the animation
     Animation animation = Animation::New( 2.0f );
     std::string relativeValue = "relative string";
     animation.AnimateBy( Property(actor, index), relativeValue );
     tet_result(TET_FAIL);
-  }
-  catch ( Dali::DaliException& e )
-  {
-    DALI_TEST_ASSERT( e, "Animated value and Property type don't match", TEST_LOCATION );
-  }
-
+  }, "Target value is not animatable" );
 
   END_TEST;
 }
@@ -10739,19 +10678,13 @@ int UtcDaliAnimationAnimateToNonAnimateableTypeN(void)
   Stage::GetCurrent().Add(actor);
   DALI_TEST_EQUALS( actor.GetProperty<int>(index), startValue, TEST_LOCATION );
 
-  try
+  DALI_TEST_ASSERTION(
   {
     // Build the animation
     Animation animation = Animation::New( 2.0f );
     std::string relativeValue = "relative string";
     animation.AnimateTo( Property(actor, index), relativeValue );
-
-    tet_result(TET_FAIL);
-  }
-  catch ( Dali::DaliException& e )
-  {
-   DALI_TEST_ASSERT( e, "Animated value and Property type don't match", TEST_LOCATION );
-  }
+  }, "Target value is not animatable" );
 
   END_TEST;
 }
@@ -10768,20 +10701,14 @@ int UtcDaliAnimationAnimateBetweenNonAnimateableTypeN(void)
   Stage::GetCurrent().Add(actor);
   DALI_TEST_EQUALS( actor.GetProperty<int>(index), startValue, TEST_LOCATION );
 
-  try
+  DALI_TEST_ASSERTION(
   {
     // Build the animation
     KeyFrames keyFrames = KeyFrames::New();
     keyFrames.Add( 0.0f, std::string("relative string1") );
     keyFrames.Add( 1.0f, std::string("relative string2") );
     // no need to really create the animation as keyframes do the check
-
-    tet_result(TET_FAIL);
-  }
-  catch ( Dali::DaliException& e )
-  {
-    DALI_TEST_ASSERT( e, "Type not animateable", TEST_LOCATION );
-  }
+  }, "Property type is not animatable" );
 
   END_TEST;
 }
@@ -13011,3 +12938,180 @@ int UtcDaliAnimationProgressCallbackLongDurationP(void)
 
   END_TEST;
 }
+
+int UtcDaliAnimationAnimateByInvalidParameters(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+  Stage::GetCurrent().Add(actor);
+
+  // Create the animation
+  Animation animation = Animation::New(1.0f);
+
+  DALI_TEST_ASSERTION(
+  {
+    // non animateable property (STRING)
+    animation.AnimateBy( Property( actor, Actor::Property::LAYOUT_DIRECTION ), Property::Value( "new direction" ) );
+  }, "Property type is not animatable" );
+
+  DALI_TEST_ASSERTION(
+  {
+    // non animateable property (MATRIX)
+    Property::Index index = actor.RegisterProperty( "Foobar", Property::Value( Dali::Matrix() ), Property::ANIMATABLE );
+    animation.AnimateBy( Property( actor, index ), Property::Value( Property::MATRIX ) );
+  }, "Property type is not animatable" );
+
+  // AnimateBy
+  DALI_TEST_ASSERTION(
+  {
+    // non animateable target (NONE)
+    animation.AnimateBy( Property( actor, Actor::Property::POSITION ), Property::Value() );
+  }, "Target value is not animatable" );
+
+  DALI_TEST_ASSERTION(
+  {
+    // non animateable target (STRING)
+    animation.AnimateBy( Property( actor, Actor::Property::POSITION ), Property::Value("foo") );
+  }, "Target value is not animatable" );
+
+  DALI_TEST_ASSERTION(
+  {
+    // not mathing properties (VECTOR3, FLOAT)
+    animation.AnimateBy( Property( actor, Actor::Property::POSITION ), Property::Value( 10.f ) );
+  }, "Property and target types don't match" );
+
+  DALI_TEST_ASSERTION(
+  {
+    // not mathing properties (VECTOR3.A, VECTOR2)
+    animation.AnimateBy( Property( actor, Actor::Property::COLOR_ALPHA ), Property::Value( Property::VECTOR2 ) );
+  }, "Property and target types don't match" );
+
+  DALI_TEST_ASSERTION(
+  {
+    // negative duration
+    animation.AnimateBy( Property( actor, Actor::Property::POSITION ), Property::Value( Vector3(1,2,3) ), TimePeriod(-1) );
+  }, "Duration must be >=0" );
+
+  END_TEST;
+}
+
+int UtcDaliAnimationAnimateToInvalidParameters(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+  Stage::GetCurrent().Add(actor);
+
+  // Create the animation
+  Animation animation = Animation::New(1.0f);
+
+  // AnimateTo
+  DALI_TEST_ASSERTION(
+  {
+    // non animateable property (MAP)
+    Property::Index index = actor.RegisterProperty( "Foobar", Property::Value( Property::MAP ), Property::ANIMATABLE );
+    animation.AnimateTo( Property( actor, index ), Property::Value( Property::MAP ) );
+  }, "Property type is not animatable" );
+
+  DALI_TEST_ASSERTION(
+  {
+    // non animateable target (NONE)
+    animation.AnimateTo( Property( actor, Actor::Property::CLIPPING_MODE ), Property::Value() );
+  }, "Property type is not animatable" );
+
+  DALI_TEST_ASSERTION(
+  {
+    // non animateable target (ARRAY)
+    animation.AnimateTo( Property( actor, Actor::Property::POSITION ), Property::Value( Property::ARRAY ) );
+  }, "Target value is not animatable" );
+
+  DALI_TEST_ASSERTION(
+  {
+    // non animateable target (RECTANGLE)
+    animation.AnimateBy( Property( actor, Actor::Property::POSITION ), Property::Value( Rect<int32_t>() ) );
+  }, "Target value is not animatable" );
+
+  DALI_TEST_ASSERTION(
+  {
+    // not mathing properties (FLOAT, INT)
+    animation.AnimateTo( Property( actor, Actor::Property::SCALE_Y ), Property::Value(10) );
+  }, "Property and target types don't match" );
+
+  DALI_TEST_ASSERTION(
+  {
+    // not mathing properties (VECTOR3, VECTOR2)
+    animation.AnimateTo( Property( actor, Actor::Property::COLOR ), Property::Value( Property::VECTOR2 ) );
+  }, "Property and target types don't match" );
+
+  DALI_TEST_ASSERTION(
+  {
+    // negative duration
+    animation.AnimateTo( Property( actor, Actor::Property::POSITION ), Property::Value( Vector3(1,2,3) ), TimePeriod(-1) );
+  }, "Duration must be >=0" );
+
+  END_TEST;
+}
+
+int UtcDaliAnimationAnimateBetweenInvalidParameters(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+  Stage::GetCurrent().Add(actor);
+
+  // Create the animation
+  Animation animation = Animation::New(1.0f);
+
+  // AnimateBetween
+  DALI_TEST_ASSERTION(
+  {
+    // non animateable property (ARRAY)
+    Property::Index index = actor.RegisterProperty( "Foobar", Property::Value( Property::ARRAY ), Property::ANIMATABLE );
+    KeyFrames keyframes = KeyFrames::New();
+    keyframes.Add( 0.5f, Property::Value( Property::ARRAY ) );
+    animation.AnimateBetween( Property( actor, index ), keyframes );
+  }, "Property type is not animatable" );
+
+  DALI_TEST_ASSERTION(
+  {
+    // non animateable target (NONE)
+    KeyFrames keyframes = KeyFrames::New();
+    keyframes.Add( 0.5f, Property::Value() );
+    animation.AnimateBetween( Property( actor, Actor::Property::CLIPPING_MODE ), keyframes );
+  }, "Property type is not animatable" );
+
+  DALI_TEST_ASSERTION(
+  {
+    // non animateable target (EXTENTS)
+    KeyFrames keyframes = KeyFrames::New();
+    keyframes.Add( 0.5f, Property::Value( Property::EXTENTS ) ); // throws
+    animation.AnimateBetween( Property( actor, Actor::Property::POSITION ), keyframes );
+  }, "Property type is not animatable" );
+
+  DALI_TEST_ASSERTION(
+  {
+    // non animateable target (RECTANGLE)
+    KeyFrames keyframes = KeyFrames::New();
+    keyframes.Add( 0.5f, Property::Value( Property::MAP ) ); // throws
+    animation.AnimateBetween( Property( actor, Actor::Property::POSITION ), keyframes );
+  }, "Property type is not animatable" );
+
+  DALI_TEST_ASSERTION(
+  {
+    // not mathing properties (VECTOR2, VECTOR4)
+    KeyFrames keyframes = KeyFrames::New();
+    keyframes.Add( 0.5f, Property::Value( Vector4( 1, 2, 3, 4 ) ) );
+    animation.AnimateBetween( Property( actor, Actor::Property::MAXIMUM_SIZE ), keyframes );
+  }, "Property and target types don't match" );
+
+  DALI_TEST_ASSERTION(
+  {
+    // negative duration
+    KeyFrames keyframes = KeyFrames::New();
+    keyframes.Add( 0.5f, Property::Value(Vector3( 1, 2, 3 ) ) );
+    animation.AnimateBetween( Property( actor, Actor::Property::POSITION ), keyframes, TimePeriod(-1) );
+  }, "Duration must be >=0" );
+
+  END_TEST;
+}
index e34cc24..24b39fa 100644 (file)
@@ -540,7 +540,7 @@ int UtcDaliHandleNonAnimatableProperties(void)
   }
   catch ( Dali::DaliException& e )
   {
-    DALI_TEST_ASSERT( e, "Animated value and Property type don't match", TEST_LOCATION );
+    DALI_TEST_ASSERT( e, "Property type is not animatable", TEST_LOCATION );
   }
 
   DALI_TEST_EQUALS( "yes", actor.GetProperty( nonAnimStringIndex ).Get<std::string>(), TEST_LOCATION );
index 6a914c3..c61b1e3 100644 (file)
@@ -82,7 +82,60 @@ const Dali::Animation::EndAction DEFAULT_DISCONNECT_ACTION( Dali::Animation::Bak
 const Dali::Animation::Interpolation DEFAULT_INTERPOLATION( Dali::Animation::Linear );
 const Dali::AlphaFunction DEFAULT_ALPHA_FUNCTION( Dali::AlphaFunction::DEFAULT );
 
-} // anon namespace
+/**
+ * Helper to tell if a property is animatable (if we have animators for it)
+ *
+ * @param type type to check
+ * @return true if animatable
+ */
+inline bool IsAnimatable( Property::Type type )
+{
+  bool animatable = false;
+  switch( type )
+  {
+    case Property::BOOLEAN :
+    case Property::FLOAT :
+    case Property::INTEGER :
+    case Property::VECTOR2 :
+    case Property::VECTOR3 :
+    case Property::VECTOR4 :
+    case Property::ROTATION :
+    {
+      animatable = true;
+      break;
+    }
+    case Property::MATRIX : // matrix is allowed as a scene graph property but there's no animators for it
+    case Property::MATRIX3 : // matrix3 is allowed as a scene graph property but there's no animators for it
+    case Property::NONE :
+    case Property::RECTANGLE :
+    case Property::STRING :
+    case Property::ARRAY :
+    case Property::MAP :
+    case Property::EXTENTS :
+    {
+      break;
+    }
+  }
+  return animatable;
+}
+
+/**
+ * Helper to validate animation input values
+ *
+ * @param propertyType type of the property that is being animated
+ * @param destinationType type of the target
+ * @param period time period of the animation
+ */
+void ValidateParameters( Property::Type propertyType, Property::Type destinationType, const TimePeriod& period )
+{
+  // destination value has to be animatable
+  DALI_ASSERT_ALWAYS( IsAnimatable( propertyType ) && "Property type is not animatable" );
+  DALI_ASSERT_ALWAYS( IsAnimatable( destinationType ) && "Target value is not animatable" );
+  DALI_ASSERT_ALWAYS( propertyType == destinationType && "Property and target types don't match" );
+  DALI_ASSERT_ALWAYS( period.durationSeconds >= 0 && "Duration must be >=0" );
+}
+
+} // anonymous namespace
 
 
 AnimationPtr Animation::New(float durationSeconds)
@@ -215,7 +268,7 @@ void Animation::SetLooping(bool on)
   SetLoopCount( on ? 0 : 1 );
 }
 
-void Animation::SetLoopCount(int count)
+void Animation::SetLoopCount(int32_t count)
 {
   // Cache for public getters
   mLoopCount = count;
@@ -224,12 +277,12 @@ void Animation::SetLoopCount(int count)
   SetLoopingMessage( mEventThreadServices, *mAnimation, mLoopCount );
 }
 
-int Animation::GetLoopCount()
+int32_t Animation::GetLoopCount()
 {
   return mLoopCount;
 }
 
-int Animation::GetCurrentLoop()
+int32_t Animation::GetCurrentLoop()
 {
   return mCurrentLoop;
 }
@@ -364,35 +417,30 @@ void Animation::Clear()
   mPlaylist.OnClear( *this );
 }
 
-void Animation::AnimateBy(Property& target, Property::Value& relativeValue)
+void Animation::AnimateBy( Property& target, Property::Value& relativeValue )
 {
-  AnimateBy(target, relativeValue, mDefaultAlpha, TimePeriod(mDurationSeconds));
+  AnimateBy( target, relativeValue, mDefaultAlpha, TimePeriod(mDurationSeconds) );
 }
 
-void Animation::AnimateBy(Property& target, Property::Value& relativeValue, AlphaFunction alpha)
+void Animation::AnimateBy( Property& target, Property::Value& relativeValue, AlphaFunction alpha )
 {
-  AnimateBy(target, relativeValue, alpha, TimePeriod(mDurationSeconds));
+  AnimateBy( target, relativeValue, alpha, TimePeriod(mDurationSeconds) );
 }
 
-void Animation::AnimateBy(Property& target, Property::Value& relativeValue, TimePeriod period)
+void Animation::AnimateBy( Property& target, Property::Value& relativeValue, TimePeriod period )
 {
-  AnimateBy(target, relativeValue, mDefaultAlpha, period);
+  AnimateBy( target, relativeValue, mDefaultAlpha, period );
 }
 
-void Animation::AnimateBy(Property& target, Property::Value& relativeValue, AlphaFunction alpha, TimePeriod period)
+void Animation::AnimateBy( Property& target, Property::Value& relativeValue, AlphaFunction alpha, TimePeriod period )
 {
   Object& object = GetImplementation(target.object);
-  const Property::Type targetType = object.GetPropertyType(target.propertyIndex);
+  const Property::Type propertyType = object.GetPropertyType( target.propertyIndex );
   const Property::Type destinationType = relativeValue.GetType();
 
-  if ( object.GetPropertyComponentIndex( target.propertyIndex ) != Property::INVALID_COMPONENT_INDEX )
-  {
-    DALI_ASSERT_ALWAYS(Property::FLOAT == destinationType && "Animated value and Property type don't match");
-  }
-  else
-  {
-    DALI_ASSERT_ALWAYS(targetType == destinationType && "Animated value and Property type don't match");
-  }
+  // validate animation parameters, if component index is set then use float as checked type
+  ValidateParameters( (target.componentIndex == Property::INVALID_COMPONENT_INDEX) ? propertyType : Property::FLOAT,
+                      destinationType, period );
 
   ExtendDuration(period);
 
@@ -404,7 +452,8 @@ void Animation::AnimateBy(Property& target, Property::Value& relativeValue, Alph
   connectorPair.animatorType = Animation::BY;
   mConnectorTargetValues.push_back( connectorPair );
 
-  switch ( targetType )
+  // using destination type so component animation gets correct type
+  switch ( destinationType )
   {
     case Property::BOOLEAN:
     {
@@ -419,12 +468,12 @@ void Animation::AnimateBy(Property& target, Property::Value& relativeValue, Alph
 
     case Property::INTEGER:
     {
-      AddAnimatorConnector( AnimatorConnector<int>::New( object,
-                                                         target.propertyIndex,
-                                                         target.componentIndex,
-                                                         new AnimateByInteger(relativeValue.Get<int>()),
-                                                         alpha,
-                                                         period ) );
+      AddAnimatorConnector( AnimatorConnector<int32_t>::New( object,
+                                                             target.propertyIndex,
+                                                             target.componentIndex,
+                                                             new AnimateByInteger(relativeValue.Get<int32_t>()),
+                                                             alpha,
+                                                             period ) );
       break;
     }
 
@@ -492,42 +541,30 @@ void Animation::AnimateBy(Property& target, Property::Value& relativeValue, Alph
   }
 }
 
-void Animation::AnimateTo(Property& target, Property::Value& destinationValue)
-{
-  AnimateTo(target, destinationValue, mDefaultAlpha, TimePeriod(mDurationSeconds));
-}
-
-void Animation::AnimateTo(Property& target, Property::Value& destinationValue, AlphaFunction alpha)
+void Animation::AnimateTo( Property& target, Property::Value& destinationValue )
 {
-  AnimateTo(target, destinationValue, alpha, TimePeriod(mDurationSeconds));
+  AnimateTo( target, destinationValue, mDefaultAlpha, TimePeriod(mDurationSeconds) );
 }
 
-void Animation::AnimateTo(Property& target, Property::Value& destinationValue, TimePeriod period)
+void Animation::AnimateTo( Property& target, Property::Value& destinationValue, AlphaFunction alpha )
 {
-  AnimateTo(target, destinationValue, mDefaultAlpha, period);
+  AnimateTo( target, destinationValue, alpha, TimePeriod(mDurationSeconds));
 }
 
-void Animation::AnimateTo(Property& target, Property::Value& destinationValue, AlphaFunction alpha, TimePeriod period)
+void Animation::AnimateTo( Property& target, Property::Value& destinationValue, TimePeriod period )
 {
-  Object& object = GetImplementation(target.object);
-
-  AnimateTo( object, target.propertyIndex, target.componentIndex, destinationValue, alpha, period );
+  AnimateTo( target, destinationValue, mDefaultAlpha, period );
 }
 
-void Animation::AnimateTo(Object& targetObject, Property::Index targetPropertyIndex, int componentIndex, Property::Value& destinationValue, AlphaFunction alpha, TimePeriod period)
+void Animation::AnimateTo( Property& target, Property::Value& destinationValue, AlphaFunction alpha, TimePeriod period )
 {
-  Property::Type targetType = targetObject.GetPropertyType(targetPropertyIndex);
-  if( componentIndex != Property::INVALID_COMPONENT_INDEX )
-  {
-    if( ( targetType == Property::VECTOR2 ) ||
-        ( targetType == Property::VECTOR3 ) ||
-        ( targetType == Property::VECTOR4 ) )
-    {
-      targetType = Property::FLOAT;
-    }
-  }
+  Object& object = GetImplementation( target.object );
+  const Property::Type propertyType = object.GetPropertyType( target.propertyIndex );
   const Property::Type destinationType = destinationValue.GetType();
-  DALI_ASSERT_ALWAYS( targetType == destinationType && "Animated value and Property type don't match" );
+
+  // validate animation parameters, if component index is set then use float as checked type
+  ValidateParameters( (target.componentIndex == Property::INVALID_COMPONENT_INDEX) ? propertyType : Property::FLOAT,
+                      destinationType, period );
 
   ExtendDuration( period );
 
@@ -539,13 +576,14 @@ void Animation::AnimateTo(Object& targetObject, Property::Index targetPropertyIn
   connectorPair.animatorType = Animation::TO;
   mConnectorTargetValues.push_back( connectorPair );
 
+  // using destination type so component animation gets correct type
   switch ( destinationType )
   {
     case Property::BOOLEAN:
     {
-      AddAnimatorConnector( AnimatorConnector<bool>::New( targetObject,
-                                                          targetPropertyIndex,
-                                                          componentIndex,
+      AddAnimatorConnector( AnimatorConnector<bool>::New( object,
+                                                          target.propertyIndex,
+                                                          target.componentIndex,
                                                           new AnimateToBoolean( destinationValue.Get<bool>() ),
                                                           alpha,
                                                           period ) );
@@ -554,20 +592,20 @@ void Animation::AnimateTo(Object& targetObject, Property::Index targetPropertyIn
 
     case Property::INTEGER:
     {
-      AddAnimatorConnector( AnimatorConnector<int>::New( targetObject,
-                                                         targetPropertyIndex,
-                                                         componentIndex,
-                                                         new AnimateToInteger( destinationValue.Get<int>() ),
-                                                         alpha,
-                                                         period ) );
+      AddAnimatorConnector( AnimatorConnector<int32_t>::New( object,
+                                                             target.propertyIndex,
+                                                             target.componentIndex,
+                                                             new AnimateToInteger( destinationValue.Get<int32_t>() ),
+                                                             alpha,
+                                                             period ) );
       break;
     }
 
     case Property::FLOAT:
     {
-      AddAnimatorConnector( AnimatorConnector<float>::New( targetObject,
-                                                           targetPropertyIndex,
-                                                           componentIndex,
+      AddAnimatorConnector( AnimatorConnector<float>::New( object,
+                                                           target.propertyIndex,
+                                                           target.componentIndex,
                                                            new AnimateToFloat( destinationValue.Get<float>() ),
                                                            alpha,
                                                            period ) );
@@ -576,9 +614,9 @@ void Animation::AnimateTo(Object& targetObject, Property::Index targetPropertyIn
 
     case Property::VECTOR2:
     {
-      AddAnimatorConnector( AnimatorConnector<Vector2>::New( targetObject,
-                                                             targetPropertyIndex,
-                                                             componentIndex,
+      AddAnimatorConnector( AnimatorConnector<Vector2>::New( object,
+                                                             target.propertyIndex,
+                                                             target.componentIndex,
                                                              new AnimateToVector2( destinationValue.Get<Vector2>() ),
                                                              alpha,
                                                              period ) );
@@ -587,9 +625,9 @@ void Animation::AnimateTo(Object& targetObject, Property::Index targetPropertyIn
 
     case Property::VECTOR3:
     {
-      AddAnimatorConnector( AnimatorConnector<Vector3>::New( targetObject,
-                                                             targetPropertyIndex,
-                                                             componentIndex,
+      AddAnimatorConnector( AnimatorConnector<Vector3>::New( object,
+                                                             target.propertyIndex,
+                                                             target.componentIndex,
                                                              new AnimateToVector3( destinationValue.Get<Vector3>() ),
                                                              alpha,
                                                              period ) );
@@ -598,9 +636,9 @@ void Animation::AnimateTo(Object& targetObject, Property::Index targetPropertyIn
 
     case Property::VECTOR4:
     {
-      AddAnimatorConnector( AnimatorConnector<Vector4>::New( targetObject,
-                                                             targetPropertyIndex,
-                                                             componentIndex,
+      AddAnimatorConnector( AnimatorConnector<Vector4>::New( object,
+                                                             target.propertyIndex,
+                                                             target.componentIndex,
                                                              new AnimateToVector4( destinationValue.Get<Vector4>() ),
                                                              alpha,
                                                              period ) );
@@ -609,9 +647,9 @@ void Animation::AnimateTo(Object& targetObject, Property::Index targetPropertyIn
 
     case Property::ROTATION:
     {
-      AddAnimatorConnector( AnimatorConnector<Quaternion>::New( targetObject,
-                                                                targetPropertyIndex,
-                                                                componentIndex,
+      AddAnimatorConnector( AnimatorConnector<Quaternion>::New( object,
+                                                                target.propertyIndex,
+                                                                target.componentIndex,
                                                                 new RotateToQuaternion( destinationValue.Get<Quaternion>() ),
                                                                 alpha,
                                                                 period ) );
@@ -625,44 +663,50 @@ void Animation::AnimateTo(Object& targetObject, Property::Index targetPropertyIn
   }
 }
 
-void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames)
+void Animation::AnimateBetween( Property target, const KeyFrames& keyFrames )
 {
-  AnimateBetween(target, keyFrames, mDefaultAlpha, TimePeriod(mDurationSeconds), DEFAULT_INTERPOLATION );
+  AnimateBetween( target, keyFrames, mDefaultAlpha, TimePeriod(mDurationSeconds), DEFAULT_INTERPOLATION );
 }
 
-void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames, Interpolation interpolation )
+void Animation::AnimateBetween( Property target, const KeyFrames& keyFrames, Interpolation interpolation )
 {
-  AnimateBetween(target, keyFrames, mDefaultAlpha, TimePeriod(mDurationSeconds), interpolation );
+  AnimateBetween( target, keyFrames, mDefaultAlpha, TimePeriod(mDurationSeconds), interpolation );
 }
 
-void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames, TimePeriod period)
+void Animation::AnimateBetween( Property target, const KeyFrames& keyFrames, TimePeriod period )
 {
-  AnimateBetween(target, keyFrames, mDefaultAlpha, period, DEFAULT_INTERPOLATION);
+  AnimateBetween( target, keyFrames, mDefaultAlpha, period, DEFAULT_INTERPOLATION );
 }
 
-void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames, TimePeriod period, Interpolation interpolation)
+void Animation::AnimateBetween( Property target, const KeyFrames& keyFrames, TimePeriod period, Interpolation interpolation )
 {
-  AnimateBetween(target, keyFrames, mDefaultAlpha, period, interpolation);
+  AnimateBetween( target, keyFrames, mDefaultAlpha, period, interpolation );
 }
 
-void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames, AlphaFunction alpha)
+void Animation::AnimateBetween( Property target, const KeyFrames& keyFrames, AlphaFunction alpha )
 {
-  AnimateBetween(target, keyFrames, alpha, TimePeriod(mDurationSeconds), DEFAULT_INTERPOLATION);
+  AnimateBetween( target, keyFrames, alpha, TimePeriod(mDurationSeconds), DEFAULT_INTERPOLATION );
 }
 
-void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames, AlphaFunction alpha, Interpolation interpolation)
+void Animation::AnimateBetween( Property target, const KeyFrames& keyFrames, AlphaFunction alpha, Interpolation interpolation )
 {
-  AnimateBetween(target, keyFrames, alpha, TimePeriod(mDurationSeconds), interpolation);
+  AnimateBetween( target, keyFrames, alpha, TimePeriod(mDurationSeconds), interpolation );
 }
 
-void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames, AlphaFunction alpha, TimePeriod period)
+void Animation::AnimateBetween( Property target, const KeyFrames& keyFrames, AlphaFunction alpha, TimePeriod period )
 {
-  AnimateBetween(target, keyFrames, alpha, period, DEFAULT_INTERPOLATION);
+  AnimateBetween( target, keyFrames, alpha, period, DEFAULT_INTERPOLATION );
 }
 
-void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames, AlphaFunction alpha, TimePeriod period, Interpolation interpolation)
+void Animation::AnimateBetween( Property target, const KeyFrames& keyFrames, AlphaFunction alpha, TimePeriod period, Interpolation interpolation )
 {
   Object& object = GetImplementation( target.object );
+  const Property::Type propertyType = object.GetPropertyType( target.propertyIndex );
+  const Property::Type destinationType = keyFrames.GetType();
+
+  // validate animation parameters, if component index is set then use float as checked type
+  ValidateParameters( (target.componentIndex == Property::INVALID_COMPONENT_INDEX) ? propertyType : Property::FLOAT,
+                      destinationType, period );
 
   ExtendDuration( period );
 
@@ -674,7 +718,8 @@ void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames, Alph
   connectorPair.animatorType = BETWEEN;
   mConnectorTargetValues.push_back( connectorPair );
 
-  switch(keyFrames.GetType())
+  // using destination type so component animation gets correct type
+  switch( destinationType )
   {
     case Dali::Property::BOOLEAN:
     {
@@ -695,7 +740,7 @@ void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames, Alph
       const KeyFrameInteger* kf;
       GetSpecialization(keyFrames, kf);
       KeyFrameIntegerPtr kfCopy = KeyFrameInteger::Clone(*kf);
-      AddAnimatorConnector( AnimatorConnector<int>::New( object,
+      AddAnimatorConnector( AnimatorConnector<int32_t>::New( object,
                                                          target.propertyIndex,
                                                          target.componentIndex,
                                                          new KeyFrameIntegerFunctor(kfCopy,interpolation),
@@ -784,7 +829,7 @@ void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames, Alph
 bool Animation::HasFinished()
 {
   bool hasFinished(false);
-  const int playedCount(mAnimation->GetPlayedCount());
+  const int32_t playedCount(mAnimation->GetPlayedCount());
 
   // If the play count has been incremented, then another notification is required
   mCurrentLoop = mAnimation->GetCurrentLoop();
index eb4d377..c605ec2 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_ANIMATION_H__
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
@@ -107,17 +107,17 @@ public:
   /**
    * @copydoc Dali::Animation::SetLoopCount()
    */
-  void SetLoopCount(int count);
+  void SetLoopCount(int32_t count);
 
   /**
    * @copydoc Dali::Animation::GetLoopCount()
    */
-  int GetLoopCount();
+  int32_t GetLoopCount();
 
   /**
    * @copydoc Dali::Animation::GetCurrentLoop()
    */
-  int GetCurrentLoop();
+  int32_t GetCurrentLoop();
 
   /**
    * @copydoc Dali::Animation::IsLooping()
@@ -283,17 +283,6 @@ public:
   void AnimateTo(Property& target, Property::Value& destinationValue, AlphaFunction alpha, TimePeriod period);
 
   /**
-   * Animate a property to a destination value.
-   * @param [in] targetObject The target object to animate.
-   * @param [in] targetPropertyIndex The index of the target property.
-   * @param [in] componentIndex Index to a sub component of a property, for use with Vector2, Vector3 and Vector4
-   * @param [in] destinationValue The destination value.
-   * @param [in] alpha The alpha function to apply.
-   * @param [in] period The effect will occur during this time period.
-   */
-  void AnimateTo(Object& targetObject, Property::Index targetPropertyIndex, int componentIndex, Property::Value& destinationValue, AlphaFunction alpha, TimePeriod period);
-
-  /**
    * @copydoc Dali::Animation::AnimateBetween(Property target, KeyFrames& keyFrames)
    */
   void AnimateBetween(Property target, const KeyFrames& keyFrames);
@@ -542,9 +531,9 @@ private:
 
   float mDurationSeconds;
   float mSpeedFactor;
-  int mNotificationCount; ///< Keep track of how many Finished signals have been emitted.
-  int mLoopCount;
-  int mCurrentLoop;
+  int32_t mNotificationCount; ///< Keep track of how many Finished signals have been emitted.
+  int32_t mLoopCount;
+  int32_t mCurrentLoop;
   EndAction mEndAction;
   EndAction mDisconnectAction;
   AlphaFunction mDefaultAlpha;
index 5a885d8..ac1bd93 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
@@ -82,7 +82,7 @@ void KeyFrames::CreateKeyFramesSpec(Property::Type type)
     }
     default:
     {
-      DALI_ABORT( "Type not animateable" );
+      DALI_ABORT( "Property type is not animatable" );
       break;
     }
   }
index 7bf745d..5e68a6e 100644 (file)
@@ -1073,7 +1073,7 @@ Property::Index Object::RegisterSceneGraphProperty(const std::string& name, Prop
     case Property::EXTENTS:
     case Property::NONE:
     {
-      DALI_ASSERT_ALWAYS( !"PropertyType is not animatable" );
+      DALI_ASSERT_ALWAYS( !"Property type is not animatable" );
       break;
     }
   }