(Vector) Check an error in SetPlayRange 46/263246/3
authorHeeyong Song <heeyong.song@samsung.com>
Mon, 30 Aug 2021 06:44:12 +0000 (15:44 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Mon, 6 Sep 2021 05:52:09 +0000 (05:52 +0000)
Change-Id: I26e2dd7d50392c911b148995cfcd81c561fea050

automated-tests/src/dali-toolkit/utc-Dali-AnimatedVectorImageVisual.cpp
dali-toolkit/internal/visuals/animated-vector-image/vector-animation-task.cpp

index 7322dbf..7f43240 100644 (file)
@@ -1590,6 +1590,10 @@ int UtcDaliAnimatedVectorImageVisualFrameDrops(void)
 
   application.GetScene().Add(actor);
 
+  Property::Map map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
+  Property::Value* value = map.Find( DevelImageVisual::Property::TOTAL_FRAME_NUMBER );
+  int totalFrameNumber = value->Get< int >();
+
   Property::Map attributes;
   DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes);
 
@@ -1605,6 +1609,7 @@ int UtcDaliAnimatedVectorImageVisualFrameDrops(void)
   // Check dropped frame
   uint32_t frames = Test::VectorAnimationRenderer::GetDroppedFrames();
   DALI_TEST_CHECK(frames > 0);
+  DALI_TEST_CHECK(frames <= static_cast<uint32_t>(totalFrameNumber));
 
   END_TEST;
 }
index 75fa62e..91bdc42 100644 (file)
@@ -254,9 +254,8 @@ void VectorAnimationTask::SetPlayRange(const Property::Array& playRange)
     std::string marker;
     if(playRange.GetElementAt(0).Get(marker))
     {
-      if(mVectorRenderer)
+      if(mVectorRenderer && mVectorRenderer.GetMarkerInfo(marker, startFrame, endFrame))
       {
-        mVectorRenderer.GetMarkerInfo(marker, startFrame, endFrame);
         valid = true;
       }
     }