From: Heeyong Song Date: Thu, 19 Mar 2020 05:38:23 +0000 (+0900) Subject: Add a test case for RenderTask X-Git-Tag: dali_1.9.5~1 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-core.git;a=commitdiff_plain;h=9eafee5e1177b99eb838264ffbd2af6d7a7988a5 Add a test case for RenderTask Change-Id: Ia31772f8f512e52d3030a46861c4c3292485d876 --- diff --git a/automated-tests/src/dali/utc-Dali-RenderTask.cpp b/automated-tests/src/dali/utc-Dali-RenderTask.cpp index b5610a3..4bd248e 100644 --- a/automated-tests/src/dali/utc-Dali-RenderTask.cpp +++ b/automated-tests/src/dali/utc-Dali-RenderTask.cpp @@ -552,6 +552,41 @@ int UtcDaliRenderTaskSetSourceActorEmpty(void) END_TEST; } +int UtcDaliRenderTaskSetSourceActorDestroyed(void) +{ + TestApplication application; + + tet_infoline( "Testing RenderTask::SetSourceActor - Set a source actor and destroy the source actor" ); + + Stage stage = Stage::GetCurrent(); + RenderTaskList taskList = stage.GetRenderTaskList(); + RenderTask task = taskList.GetTask( 0u ); + + Actor actor = task.GetSourceActor(); + DALI_TEST_CHECK( actor ); + + BufferImage img = BufferImage::New( 1,1 ); + Actor newActor = CreateRenderableActor( img ); + newActor.SetSize(1,1); + stage.Add( newActor ); + + task.SetSourceActor( newActor ); + + DALI_TEST_CHECK( task.GetSourceActor() != actor ); + DALI_TEST_CHECK( task.GetSourceActor() == newActor ); + + application.SendNotification(); + application.Render(); + + // Destroy the source actor + stage.Remove( newActor ); + newActor.Reset(); + + DALI_TEST_CHECK( !task.GetSourceActor() ); // The source actor should be an empty handle. + + END_TEST; +} + int UtcDaliRenderTaskGetSourceActorP01(void) { TestApplication application; @@ -967,6 +1002,29 @@ int UtcDaliRenderTaskSetCameraActorN(void) END_TEST; } +int UtcDaliRenderTaskSetCameraActorDestroyed(void) +{ + TestApplication application; + + tet_infoline( "Testing RenderTask::SetCameraActor - Set a camera actor and destroy the camera actor" ); + + Stage stage = Stage::GetCurrent(); + RenderTaskList taskList = stage.GetRenderTaskList(); + RenderTask task = taskList.GetTask( 0u ); + + CameraActor newCameraActor = CameraActor::New(); + task.SetCameraActor( newCameraActor ); + + DALI_TEST_EQUALS( task.GetCameraActor(), newCameraActor, TEST_LOCATION ); + + // Destroy the camera actor + newCameraActor.Reset(); + + CameraActor camera = task.GetCameraActor(); + DALI_TEST_CHECK( !camera ); // The camera actor should be an empty handle. + + END_TEST; +} int UtcDaliRenderTaskGetCameraActorP(void) {