X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Futc-Dali-TransitionData.cpp;h=1db1bc52d0176b4500c728d1c6fdf055b820d1c9;hp=14b19b6d6173971ece68200265da60b4b80c86c5;hb=a76b6c2b9fc30dd5e8f5f7e0cfd2537e274fd71e;hpb=851f310dc14f9a8ea99b458519c84533e57e3e92 diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TransitionData.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TransitionData.cpp index 14b19b6..1db1bc5 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-TransitionData.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TransitionData.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 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. @@ -19,10 +19,10 @@ #include #include #include +#include #include #include #include -#include #include "dummy-control.h" using namespace Dali; @@ -136,7 +136,7 @@ void CHECK_MAP_EQUALS( Property::Map test, Property::Map result ) int UtcDaliTransitionDataNew(void) { - TestApplication application; + ToolkitTestApplication application; Property::Map map = CreateMap(); Dali::Toolkit::TransitionData transition = TransitionData::New( map ); @@ -147,7 +147,7 @@ int UtcDaliTransitionDataNew(void) int UtcDaliTransitionDataDownCast(void) { - TestApplication application; + ToolkitTestApplication application; Property::Map map = CreateMap(); @@ -161,7 +161,7 @@ int UtcDaliTransitionDataDownCast(void) int UtcDaliTransitionDataCopyConstructor(void) { - TestApplication application; + ToolkitTestApplication application; Property::Map map = CreateMap(); @@ -176,7 +176,7 @@ int UtcDaliTransitionDataCopyConstructor(void) int UtcDaliTransitionDataAssignmentOperator(void) { - TestApplication application; + ToolkitTestApplication application; Property::Map map = CreateMap(); @@ -195,7 +195,7 @@ int UtcDaliTransitionDataAssignmentOperator(void) int UtcDaliTransitionDataCount(void) { - TestApplication application; + ToolkitTestApplication application; Property::Map map = CreateMap(); TransitionData transitionData = TransitionData::New( map ); @@ -216,7 +216,7 @@ int UtcDaliTransitionDataCount(void) int UtcDaliTransitionDataMap1P(void) { - TestApplication application; + ToolkitTestApplication application; tet_printf("Testing animation of a visual property using stylesheet equivalent maps\n"); @@ -255,14 +255,13 @@ int UtcDaliTransitionDataMap1P(void) Renderer renderer = actor.GetRendererAt(0); Property::Index mixColorIndex = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR ); - Property::Index opacityIndex = DevelHandle::GetPropertyIndex( renderer, DevelVisual::Property::OPACITY ); application.SendNotification(); application.Render(0); DALI_TEST_EQUALS( renderer.GetProperty(mixColorIndex), Vector3(Color::MAGENTA), TEST_LOCATION); DALI_TEST_EQUALS( renderer.GetCurrentProperty< Vector3 >( mixColorIndex ), Vector3(Color::MAGENTA), TEST_LOCATION ); - DALI_TEST_EQUALS( renderer.GetProperty(opacityIndex), 1.0f, 0.001f, TEST_LOCATION ); - DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( opacityIndex ), 1.0f, 0.001f, TEST_LOCATION ); + DALI_TEST_EQUALS( renderer.GetProperty( DevelRenderer::Property::OPACITY ), 1.0f, 0.001f, TEST_LOCATION ); + DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( DevelRenderer::Property::OPACITY ), 1.0f, 0.001f, TEST_LOCATION ); anim.Play(); @@ -271,12 +270,12 @@ int UtcDaliTransitionDataMap1P(void) application.Render(500); // Halfway thru anim application.SendNotification(); DALI_TEST_EQUALS( renderer.GetCurrentProperty< Vector3 >( mixColorIndex ), Vector3(Color::MAGENTA+Color::RED)*0.5f, TEST_LOCATION); - DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( opacityIndex ), 1.0f, 0.001f, TEST_LOCATION ); + DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( DevelRenderer::Property::OPACITY ), 1.0f, 0.001f, TEST_LOCATION ); application.Render(500); // End of anim application.SendNotification(); DALI_TEST_EQUALS( renderer.GetCurrentProperty< Vector3 >( mixColorIndex ), Vector3(Color::RED), TEST_LOCATION ); - DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( opacityIndex ), 1.0f, 0.001f, TEST_LOCATION ); + DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( DevelRenderer::Property::OPACITY ), 1.0f, 0.001f, TEST_LOCATION ); END_TEST; } @@ -285,7 +284,7 @@ int UtcDaliTransitionDataMap1P(void) int UtcDaliTransitionDataMap2P(void) { - TestApplication application; + ToolkitTestApplication application; tet_printf("Testing animation of a visual property using programmatic maps\n"); @@ -324,14 +323,13 @@ int UtcDaliTransitionDataMap2P(void) Renderer renderer = actor.GetRendererAt(0); Property::Index mixColorIndex = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR ); - Property::Index opacityIndex = DevelHandle::GetPropertyIndex( renderer, DevelVisual::Property::OPACITY ); application.SendNotification(); application.Render(0); DALI_TEST_EQUALS( renderer.GetProperty(mixColorIndex), Vector3(Color::MAGENTA), TEST_LOCATION); DALI_TEST_EQUALS( renderer.GetCurrentProperty< Vector3 >( mixColorIndex ), Vector3(Color::MAGENTA), TEST_LOCATION ); - DALI_TEST_EQUALS( renderer.GetProperty(opacityIndex), 1.0f, 0.001f, TEST_LOCATION ); - DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( opacityIndex ), 1.0f, 0.001f, TEST_LOCATION ); + DALI_TEST_EQUALS( renderer.GetProperty( DevelRenderer::Property::OPACITY ), 1.0f, 0.001f, TEST_LOCATION ); + DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( DevelRenderer::Property::OPACITY ), 1.0f, 0.001f, TEST_LOCATION ); anim.Play(); @@ -341,12 +339,12 @@ int UtcDaliTransitionDataMap2P(void) application.Render(500); // Halfway thru anim application.SendNotification(); DALI_TEST_EQUALS( renderer.GetCurrentProperty< Vector3 >( mixColorIndex ), Vector3(Color::MAGENTA+Color::RED)*0.5f, TEST_LOCATION); - DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( opacityIndex ), 1.0f, 0.001f, TEST_LOCATION); + DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( DevelRenderer::Property::OPACITY ), 1.0f, 0.001f, TEST_LOCATION); application.Render(500); // End of anim application.SendNotification(); DALI_TEST_EQUALS( renderer.GetCurrentProperty< Vector3 >( mixColorIndex ), Vector3(Color::RED), TEST_LOCATION ); - DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( opacityIndex ), 1.0f, 0.001f, TEST_LOCATION); + DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( DevelRenderer::Property::OPACITY ), 1.0f, 0.001f, TEST_LOCATION); END_TEST; } @@ -354,7 +352,7 @@ int UtcDaliTransitionDataMap2P(void) int UtcDaliTransitionDataMap2Pb(void) { - TestApplication application; + ToolkitTestApplication application; tet_printf("Testing animation of a visual property using programmatic maps\n"); @@ -397,14 +395,13 @@ int UtcDaliTransitionDataMap2Pb(void) Renderer renderer = actor.GetRendererAt(0); Property::Index mixColorIndex = DevelHandle::GetPropertyIndex( renderer, PrimitiveVisual::Property::MIX_COLOR ); - Property::Index opacityIndex = DevelHandle::GetPropertyIndex( renderer, DevelVisual::Property::OPACITY ); application.SendNotification(); application.Render(0); DALI_TEST_EQUALS( renderer.GetProperty(mixColorIndex), Vector3(Color::MAGENTA), TEST_LOCATION); DALI_TEST_EQUALS( renderer.GetCurrentProperty< Vector3 >( mixColorIndex ), Vector3(Color::MAGENTA), TEST_LOCATION ); - DALI_TEST_EQUALS( renderer.GetProperty(opacityIndex), 1.0f, 0.001f, TEST_LOCATION ); - DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( opacityIndex ), 1.0f, 0.001f, TEST_LOCATION ); + DALI_TEST_EQUALS( renderer.GetProperty( DevelRenderer::Property::OPACITY ), 1.0f, 0.001f, TEST_LOCATION ); + DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( DevelRenderer::Property::OPACITY ), 1.0f, 0.001f, TEST_LOCATION ); anim.Play(); @@ -414,12 +411,12 @@ int UtcDaliTransitionDataMap2Pb(void) application.Render(500); // Halfway thru anim application.SendNotification(); DALI_TEST_EQUALS( renderer.GetCurrentProperty< Vector3 >( mixColorIndex ), Vector3(Color::MAGENTA+Color::RED)*0.5f, TEST_LOCATION); - DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( opacityIndex ), 1.0f, 0.001f, TEST_LOCATION); + DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( DevelRenderer::Property::OPACITY ), 1.0f, 0.001f, TEST_LOCATION); application.Render(500); // End of anim application.SendNotification(); DALI_TEST_EQUALS( renderer.GetCurrentProperty< Vector3 >( mixColorIndex ), Vector3(Color::RED), TEST_LOCATION ); - DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( opacityIndex ), 1.0f, 0.001f, TEST_LOCATION); + DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( DevelRenderer::Property::OPACITY ), 1.0f, 0.001f, TEST_LOCATION); END_TEST; } @@ -427,7 +424,7 @@ int UtcDaliTransitionDataMap2Pb(void) int UtcDaliTransitionDataMap3P(void) { - TestApplication application; + ToolkitTestApplication application; tet_printf("Testing animation of an actor's position property using bezier curve\n"); @@ -483,7 +480,7 @@ int UtcDaliTransitionDataMap3P(void) int UtcDaliTransitionDataMap4P(void) { - TestApplication application; + ToolkitTestApplication application; tet_printf("Testing animation of a visual's transform property using programmatic maps\n"); @@ -555,7 +552,7 @@ int UtcDaliTransitionDataMap4P(void) int UtcDaliTransitionDataMap5P(void) { - TestApplication application; + ToolkitTestApplication application; tet_printf("Testing animation visual opacity using stylesheet equivalent maps\n"); @@ -594,16 +591,15 @@ int UtcDaliTransitionDataMap5P(void) Renderer renderer = actor.GetRendererAt(0); Property::Index mixColorIndex = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR ); - Property::Index opacityIndex = DevelHandle::GetPropertyIndex( renderer, DevelVisual::Property::OPACITY ); application.SendNotification(); application.Render(0); DALI_TEST_EQUALS( renderer.GetProperty(mixColorIndex), Vector3(Color::MAGENTA), TEST_LOCATION); - DALI_TEST_EQUALS( renderer.GetProperty(opacityIndex), 0.0f, 0.001f, TEST_LOCATION ); + DALI_TEST_EQUALS( renderer.GetProperty( DevelRenderer::Property::OPACITY ), 0.0f, 0.001f, TEST_LOCATION ); DALI_TEST_EQUALS( renderer.GetProperty(Renderer::Property::BLEND_MODE), (int)BlendMode::ON, TEST_LOCATION ); DALI_TEST_EQUALS( renderer.GetCurrentProperty< Vector3 >( mixColorIndex ), Vector3(Color::MAGENTA), TEST_LOCATION); - DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( opacityIndex ), 0.0f, 0.001f, TEST_LOCATION ); + DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( DevelRenderer::Property::OPACITY ), 0.0f, 0.001f, TEST_LOCATION ); DALI_TEST_EQUALS( renderer.GetCurrentProperty< int >( Renderer::Property::BLEND_MODE ), (int)BlendMode::ON, TEST_LOCATION ); anim.Play(); @@ -613,13 +609,14 @@ int UtcDaliTransitionDataMap5P(void) application.Render(500); // Halfway thru anim application.SendNotification(); DALI_TEST_EQUALS( renderer.GetCurrentProperty< Vector3 >( mixColorIndex ), Vector3(Color::MAGENTA), TEST_LOCATION); - DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( opacityIndex ), 0.5f, 0.001f, TEST_LOCATION ); + DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( DevelRenderer::Property::OPACITY ), 0.5f, 0.001f, TEST_LOCATION ); DALI_TEST_EQUALS( renderer.GetCurrentProperty< int >( Renderer::Property::BLEND_MODE ), (int)BlendMode::ON, TEST_LOCATION ); application.Render(501); // End of anim application.SendNotification(); + application.Render(); DALI_TEST_EQUALS( renderer.GetCurrentProperty< Vector3 >( mixColorIndex ), Vector3(Color::MAGENTA), TEST_LOCATION ); - DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( opacityIndex ), 1.0f, 0.001f, TEST_LOCATION ); + DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( DevelRenderer::Property::OPACITY ), 1.0f, 0.001f, TEST_LOCATION ); DALI_TEST_EQUALS( renderer.GetCurrentProperty< int >( Renderer::Property::BLEND_MODE ), (int)BlendMode::AUTO, TEST_LOCATION ); END_TEST; @@ -628,7 +625,7 @@ int UtcDaliTransitionDataMap5P(void) int UtcDaliTransitionDataMap6P(void) { - TestApplication application; + ToolkitTestApplication application; tet_printf("Testing animation visual opacity using stylesheet equivalent maps\n"); @@ -666,14 +663,13 @@ int UtcDaliTransitionDataMap6P(void) Renderer renderer = actor.GetRendererAt(0); Property::Index mixColorIndex = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR ); - Property::Index opacityIndex = DevelHandle::GetPropertyIndex( renderer, DevelVisual::Property::OPACITY ); application.SendNotification(); application.Render(0); DALI_TEST_EQUALS( renderer.GetProperty(mixColorIndex), Vector3(Color::MAGENTA), TEST_LOCATION); DALI_TEST_EQUALS( renderer.GetCurrentProperty< Vector3 >( mixColorIndex ), Vector3(Color::MAGENTA), TEST_LOCATION); - DALI_TEST_EQUALS( renderer.GetProperty(opacityIndex), 1.0f, 0.001f, TEST_LOCATION ); - DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( opacityIndex ), 1.0f, 0.001f, TEST_LOCATION ); + DALI_TEST_EQUALS( renderer.GetProperty( DevelRenderer::Property::OPACITY ), 1.0f, 0.001f, TEST_LOCATION ); + DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( DevelRenderer::Property::OPACITY ), 1.0f, 0.001f, TEST_LOCATION ); // Note, This should be testing for AUTO // this is the same problem as C# target value being set before Play is called. @@ -688,13 +684,13 @@ int UtcDaliTransitionDataMap6P(void) application.Render(500); // Halfway thru anim application.SendNotification(); DALI_TEST_EQUALS( renderer.GetCurrentProperty< Vector3 >( mixColorIndex ), Vector3(Color::MAGENTA), TEST_LOCATION); - DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( opacityIndex ), 0.5f, 0.001f, TEST_LOCATION ); + DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( DevelRenderer::Property::OPACITY ), 0.5f, 0.001f, TEST_LOCATION ); DALI_TEST_EQUALS( renderer.GetCurrentProperty< int >( Renderer::Property::BLEND_MODE ), (int)BlendMode::ON, TEST_LOCATION ); application.Render(500); // End of anim application.SendNotification(); DALI_TEST_EQUALS( renderer.GetCurrentProperty< Vector3 >( mixColorIndex ), Vector3(Color::MAGENTA), TEST_LOCATION ); - DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( opacityIndex ), 0.0f, 0.001f, TEST_LOCATION ); + DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( DevelRenderer::Property::OPACITY ), 0.0f, 0.001f, TEST_LOCATION ); DALI_TEST_EQUALS( renderer.GetCurrentProperty< int >( Renderer::Property::BLEND_MODE ), (int)BlendMode::ON, TEST_LOCATION ); END_TEST; @@ -703,7 +699,7 @@ int UtcDaliTransitionDataMap6P(void) int UtcDaliTransitionDataMap1N(void) { - TestApplication application; + ToolkitTestApplication application; Property::Map map; map["target"] = "Actor1"; @@ -735,7 +731,7 @@ int UtcDaliTransitionDataMap1N(void) int UtcDaliTransitionDataMapN3(void) { - TestApplication application; + ToolkitTestApplication application; tet_printf("Testing visual lookup with no renderers\n"); @@ -777,7 +773,7 @@ int UtcDaliTransitionDataMapN3(void) int UtcDaliTransitionDataMapN4(void) { - TestApplication application; + ToolkitTestApplication application; tet_printf("Testing visual doesn't animate with duff bezier data \n"); @@ -819,18 +815,17 @@ int UtcDaliTransitionDataMapN4(void) Renderer renderer = actor.GetRendererAt(0); Property::Index mixColorIdx = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR ); - Property::Index opacityIdx = DevelHandle::GetPropertyIndex( renderer, DevelVisual::Property::OPACITY ); tet_printf( "Test that the property has been set to target value\n"); DALI_TEST_EQUALS(renderer.GetProperty(mixColorIdx), Vector3(Color::RED), 0.001, TEST_LOCATION); - DALI_TEST_EQUALS(renderer.GetProperty(opacityIdx), 1.0f, 0.001, TEST_LOCATION); + DALI_TEST_EQUALS(renderer.GetProperty( DevelRenderer::Property::OPACITY ), 1.0f, 0.001, TEST_LOCATION); END_TEST; } int UtcDaliTransitionDataMapN5(void) { - TestApplication application; + ToolkitTestApplication application; tet_printf("Testing visual doesn't animate with duff bezier data \n"); @@ -881,7 +876,7 @@ int UtcDaliTransitionDataMapN5(void) int UtcDaliTransitionDataMapN6(void) { - TestApplication application; + ToolkitTestApplication application; tet_printf("Testing visual doesn't animate with duff bezier data \n"); @@ -923,11 +918,10 @@ int UtcDaliTransitionDataMapN6(void) Renderer renderer = actor.GetRendererAt(0); Property::Index mixColorIdx = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR ); - Property::Index opacityIdx = DevelHandle::GetPropertyIndex( renderer, DevelVisual::Property::OPACITY ); tet_printf( "Test that the property has been set to target value\n"); DALI_TEST_EQUALS(renderer.GetProperty(mixColorIdx), Vector3(Color::RED), 0.001, TEST_LOCATION); - DALI_TEST_EQUALS(renderer.GetProperty(opacityIdx), 1.0f, 0.001, TEST_LOCATION); + DALI_TEST_EQUALS(renderer.GetProperty( DevelRenderer::Property::OPACITY ), 1.0f, 0.001, TEST_LOCATION); END_TEST; } @@ -935,7 +929,7 @@ int UtcDaliTransitionDataMapN6(void) int UtcDaliTransitionDataArrayP(void) { - TestApplication application; + ToolkitTestApplication application; Property::Map map1; map1["target"] = "Actor1"; @@ -1011,7 +1005,7 @@ int UtcDaliTransitionDataArrayP(void) int UtcDaliTransitionDataGetAnimatorP(void) { - TestApplication application; + ToolkitTestApplication application; Property::Map map1; map1["target"] = "Actor1";