Fix tc failure 17/287117/3
authorHeeyong Song <heeyong.song@samsung.com>
Fri, 20 Jan 2023 02:09:23 +0000 (11:09 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Wed, 25 Jan 2023 02:02:50 +0000 (11:02 +0900)
Change-Id: If6357dcd3b5b1aea5dbf49bcdfee0cda4da87886

automated-tests/src/dali-toolkit/utc-Dali-AnimatedImageVisual.cpp
automated-tests/src/dali-toolkit/utc-Dali-AsyncImageLoader.cpp

index 3c23a06..7edefb1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
@@ -1103,6 +1103,9 @@ int UtcDaliAnimatedImageVisualAnimatedImageWithAlphaMask02(void)
     dummyControl.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
     application.GetScene().Add(dummyControl);
 
+    Property::Map attributes;
+    DevelControl::DoAction(dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedImageVisual::Action::STOP, attributes);
+
     application.SendNotification();
     application.Render();
 
@@ -1112,7 +1115,7 @@ int UtcDaliAnimatedImageVisualAnimatedImageWithAlphaMask02(void)
     application.SendNotification();
     application.Render(20);
 
-    DALI_TEST_EQUALS(gl.GetLastGenTextureId(), 3, TEST_LOCATION);
+    DALI_TEST_EQUALS(gl.GetNumGeneratedTextures(), 3, TEST_LOCATION);
 
     dummyControl.Unparent();
   }
@@ -1982,4 +1985,4 @@ int UtcDaliAnimatedImageVisualDesiredSize(void)
   }
 
   END_TEST;
-}
\ No newline at end of file
+}
index f68397d..70263e6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
  */
 #include <dali-toolkit-test-suite-utils.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/image-loader/async-image-loader-devel.h>
 #include <dali/dali.h>
 #include <dali/devel-api/actors/actor-devel.h>
 #include <stdlib.h>
 #include <toolkit-event-thread-callback.h>
 #include <unistd.h>
-#include <dali-toolkit/devel-api/image-loader/async-image-loader-devel.h>
 
 using namespace Dali;
 using namespace Dali::Toolkit;
@@ -212,25 +212,25 @@ int UtcDaliAsyncImageLoaderLoadAndLoadedSignal(void)
 
   loader.ImageLoadedSignal().Connect(&loadedSignalVerifier, &ImageLoadedSignalVerifier::ImageLoaded);
 
-  loader.Load(gImage_34_RGBA);
-  uint32_t id02 = loader.Load(gImage_50_RGBA, ImageDimensions(25, 25));
-  uint32_t id03 = loader.Load(gImage_128_RGB, ImageDimensions(100, 100), FittingMode::SCALE_TO_FILL, SamplingMode::BOX_THEN_LINEAR, true);
+  loader.Load(gImage_34_RGBA);                                                                                                             // Trigger 1
+  uint32_t id02 = loader.Load(gImage_50_RGBA, ImageDimensions(25, 25));                                                                    // Trigger 2
+  uint32_t id03 = loader.Load(gImage_128_RGB, ImageDimensions(100, 100), FittingMode::SCALE_TO_FILL, SamplingMode::BOX_THEN_LINEAR, true); // Trigger 3
 
   // Try load animted image
   Dali::AnimatedImageLoading animatedImageLoading = Dali::AnimatedImageLoading::New(gImage_gif, true);
-  DevelAsyncImageLoader::LoadAnimatedImage(loader, animatedImageLoading, 0, DevelAsyncImageLoader::PreMultiplyOnLoad::OFF);
+  DevelAsyncImageLoader::LoadAnimatedImage(loader, animatedImageLoading, 0, DevelAsyncImageLoader::PreMultiplyOnLoad::OFF); // Trigger 4
 
   // Try apply mask image
   Devel::PixelBuffer imageData = Devel::PixelBuffer::New(50, 50, Dali::Pixel::RGBA8888);
-  Devel::PixelBuffer maskData = Devel::PixelBuffer::New(50, 50, Dali::Pixel::RGBA8888);
-  DevelAsyncImageLoader::ApplyMask(loader, imageData, maskData, 0.0f, false, DevelAsyncImageLoader::PreMultiplyOnLoad::OFF);
+  Devel::PixelBuffer maskData  = Devel::PixelBuffer::New(50, 50, Dali::Pixel::RGBA8888);
+  DevelAsyncImageLoader::ApplyMask(loader, imageData, maskData, 0.0f, false, DevelAsyncImageLoader::PreMultiplyOnLoad::OFF); // Trigger 5 - ApplyMask also uses AsyncTask
 
-  DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(4), true, TEST_LOCATION);
+  DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(5), true, TEST_LOCATION); // Wait for 5 triggers
 
   application.SendNotification();
   application.Render();
 
-  DALI_TEST_CHECK(loadedSignalVerifier.LoadedImageCount() == 4);
+  DALI_TEST_CHECK(loadedSignalVerifier.LoadedImageCount() == 5);
   DALI_TEST_CHECK(loadedSignalVerifier.Verify(id02, 25, 25));
   DALI_TEST_CHECK(loadedSignalVerifier.Verify(id03, 100, 100));
 
@@ -272,7 +272,7 @@ int UtcDaliAsyncImageLoaderCancel02(void)
   ToolkitTestApplication application;
 
   AsyncImageLoader loader = AsyncImageLoader::New();
-  uint32_t id01 = loader.Load(gImage_34_RGBA, ImageDimensions(34, 34));
+  uint32_t         id01   = loader.Load(gImage_34_RGBA, ImageDimensions(34, 34));
   DALI_TEST_CHECK(loader.Cancel(id01)); // Cancle a task
 
   application.SendNotification();
@@ -314,4 +314,4 @@ int UtcDaliAsyncImageLoaderCancelAll(void)
   application.Render();
 
   END_TEST;
-}
\ No newline at end of file
+}