(VectorAnimation) Fix rarely UTC failed at UtcDaliAnimatedVectorImageVisualDynamicPro... 78/321478/1
authorEunki Hong <eunkiki.hong@samsung.com>
Sat, 22 Mar 2025 13:55:23 +0000 (22:55 +0900)
committerEunki Hong <eunkiki.hong@samsung.com>
Sat, 22 Mar 2025 13:55:23 +0000 (22:55 +0900)
When CPU is busy, UtcDaliAnimatedVectorImageVisualDynamicProperty02 failed very rarely.

Let we retry to get value again, so VectorAnimationThread progressed
at least 2 times for this UTC.

Change-Id: I96f07da1fd7b05ade347199245e08d7946d145f4
Signed-off-by: Eunki Hong <eunkiki.hong@samsung.com>
automated-tests/src/dali-toolkit/utc-Dali-AnimatedVectorImageVisual.cpp

index a391ccbdb8c693821ad506b684f21a95f713da63..3467c5cc540b28f56e524a148c412b2ffa77e299 100644 (file)
@@ -2737,6 +2737,31 @@ int UtcDaliAnimatedVectorImageVisualDynamicProperty02(void)
   // Test whether the property callback is called
   DALI_TEST_EQUALS(gDynamicPropertyCallbackFiredMap[1], true, TEST_LOCATION);
   DALI_TEST_EQUALS(gDynamicPropertyCallbackFiredMap[2], true, TEST_LOCATION);
+
+  int tryCount    = 0;
+  int tryCountMax = 25;
+  // Third callback might not be applied to vector animation tasks. Retry again until it successed.
+  while(tryCount++ < tryCountMax)
+  {
+    const bool tryAgain = !gDynamicPropertyCallbackFiredMap[3];
+    if(tryAgain)
+    {
+      tet_printf("Retry to get value again! [%d]\n", tryCount);
+      application.SendNotification();
+      application.Render();
+
+      // Dummy sleep 1 second.
+      Test::WaitForEventThreadTrigger(1, 1);
+
+      application.SendNotification();
+      application.Render();
+      continue;
+    }
+    else
+    {
+      break;
+    }
+  }
   DALI_TEST_EQUALS(gDynamicPropertyCallbackFiredMap[3], true, TEST_LOCATION);
 
   END_TEST;