[UTC][dali-core][Non-ACR][Fix Clear Animation test] 69/216469/1
authorSunghyun kim <scholb.kim@samsung.com>
Fri, 25 Oct 2019 08:30:37 +0000 (17:30 +0900)
committerSunghyun kim <scholb.kim@samsung.com>
Fri, 25 Oct 2019 08:30:37 +0000 (17:30 +0900)
Existing test for animation can fail depending on the timing.
Therefore, TC was modified so that it could do more clear test.

Change-Id: Ica4a1f196f52a136c9c6986fd47cda04ad097175

src/utc/dali-core/animation/utc-dali-animation-impl.h

index a752dbee567771fca162e7c28a9ee265f6409730..6f950af1dc5082ec930275cedb0c051abb77d553 100755 (executable)
@@ -18,6 +18,7 @@ int gIntAnimDefaultStart = 10;
 int gIntAnimDefaultTarget = 50;
 bool gBoolAnimStart(false);
 Vector3 gVec3Progress;
+Vector3 gVec3ProgressNext;
 Vector3 gVec3TargetPosition(10.0f, 10.0f, 10.0f);
 Property::Index gAnimPropertyIndex;
 const bool gBoolAnimRelativeValue(true);
@@ -724,7 +725,12 @@ void VTAnimationClear001()
 void VTAnimationClear002()
 {
   DALI_CHECK_FAIL( gBoolSignalReceived, " Signal is received which is unexpected after clear.");
-  DALI_CHECK_FAIL( gVec3Progress != gActorAnim.GetCurrentPosition(),
+  gVec3ProgressNext = gActorAnim.GetCurrentPosition();
+  bool bIsInProgress = ( gVec3ProgressNext.x >= gVec3Progress.x && gVec3ProgressNext.x < gVec3TargetPosition.x ) &&
+    ( gVec3ProgressNext.y >= gVec3Progress.y && gVec3ProgressNext.y < gVec3TargetPosition.y ) &&
+    ( gVec3ProgressNext.z >= gVec3Progress.z && gVec3ProgressNext.z < gVec3TargetPosition.z ) ;
+
+  DALI_CHECK_FAIL( !bIsInProgress,
       "Actor's property should be still within the progress value due to clearing the animation before animation time." );
 
   Stage::GetCurrent().Remove(gActorAnim);