X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali%2Futc-Dali-Animation.cpp;h=6a67e8d0a2d6685828a5e6646d5b2a602a90ca70;hb=0c17fedc6fae9c4ca443b1eda9eab846215ca518;hp=860a01e74bda7a4063d6a43c7cbd61b69a21de6e;hpb=7b2614e862b16ec1248cbc3d781fdfd6e5ce9edf;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/automated-tests/src/dali/utc-Dali-Animation.cpp b/automated-tests/src/dali/utc-Dali-Animation.cpp index 860a01e..6a67e8d 100644 --- a/automated-tests/src/dali/utc-Dali-Animation.cpp +++ b/automated-tests/src/dali/utc-Dali-Animation.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 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. @@ -20,7 +20,9 @@ #include #include +#include #include +#include using std::max; using namespace Dali; @@ -40,6 +42,7 @@ namespace static const float ROTATION_EPSILON = 0.0001f; static const float VECTOR4_EPSILON = 0.0001f; +static const float VECTOR3_EPSILON = 0.0001f; // Functor to test whether a Finish signal is emitted struct AnimationFinishCheck @@ -88,6 +91,55 @@ struct AnimationFinishCheck bool& mSignalReceived; // owned by individual tests }; +// Functor to test whether a Progress signal is emitted +struct AnimationProgressCheck +{ + AnimationProgressCheck(bool& signalReceived, std::string name = " ") + : mSignalReceived(signalReceived), + mName( name ) + { + } + + void operator()(Animation& animation) + { + mSignalReceived = true; + } + + void Reset() + { + mSignalReceived = false; + } + + void CheckSignalReceived() + { + if (!mSignalReceived) + { + tet_printf("Expected Progress reached signal was not received %s \n", mName.c_str() ); + tet_result(TET_FAIL); + } + else + { + tet_result(TET_PASS); + } + } + + void CheckSignalNotReceived() + { + if (mSignalReceived) + { + tet_printf("Unexpected Progress reached signal was received %s \n", mName.c_str()); + tet_result(TET_FAIL); + } + else + { + tet_result(TET_PASS); + } + } + + bool& mSignalReceived; // owned by individual tests + std::string mName; +}; + } // anon namespace int UtcDaliAnimationConstructorP(void) @@ -216,7 +268,7 @@ int UtcDaliAnimationSetDurationP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( targetPosition, actor.GetCurrentPosition(), TEST_LOCATION ); + DALI_TEST_EQUALS( targetPosition, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); // Restart the animation, with a different duration finishCheck.Reset(); @@ -238,13 +290,13 @@ int UtcDaliAnimationSetDurationP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( targetPosition, actor.GetCurrentPosition(), TEST_LOCATION ); + DALI_TEST_EQUALS( targetPosition, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_EQUALS( targetPosition, actor.GetCurrentPosition(), TEST_LOCATION ); + DALI_TEST_EQUALS( targetPosition, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( targetPosition, actor.GetCurrentPosition(), TEST_LOCATION ); + DALI_TEST_EQUALS( targetPosition, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); END_TEST; } @@ -304,7 +356,7 @@ int UtcDaliAnimationSetLoopingP(void) application.Render(static_cast(durationSeconds*intervalSeconds*1000.0f)); progress += intervalSeconds; - DALI_TEST_EQUALS( targetPosition*progress, actor.GetCurrentPosition(), 0.001f, TEST_LOCATION ); + DALI_TEST_EQUALS( targetPosition*progress, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), 0.001f, TEST_LOCATION ); if (progress >= 1.0f) { @@ -326,13 +378,13 @@ int UtcDaliAnimationSetLoopingP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( targetPosition, actor.GetCurrentPosition(), TEST_LOCATION ); + DALI_TEST_EQUALS( targetPosition, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_EQUALS( targetPosition, actor.GetCurrentPosition(), TEST_LOCATION ); + DALI_TEST_EQUALS( targetPosition, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( targetPosition, actor.GetCurrentPosition(), TEST_LOCATION ); + DALI_TEST_EQUALS( targetPosition, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); END_TEST; } @@ -387,7 +439,7 @@ int UtcDaliAnimationSetLoopCountP(void) application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( targetPosition, actor.GetCurrentPosition(), TEST_LOCATION ); + DALI_TEST_EQUALS( targetPosition, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); finishCheck.Reset(); @@ -624,7 +676,7 @@ int UtcDaliAnimationSetLoopCountP4(void) application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); actor.SetProperty( Actor::Property::POSITION, Vector3(0.0f, 0.0f, 0.0f) ); finishCheck.Reset(); @@ -638,7 +690,7 @@ int UtcDaliAnimationSetLoopCountP4(void) application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); END_TEST; } @@ -764,7 +816,7 @@ int UtcDaliAnimationIsLoopingP(void) END_TEST; } -int UtcDaliAnimationSetEndActioN(void) +int UtcDaliAnimationSetEndActionN(void) { TestApplication application; @@ -792,13 +844,13 @@ int UtcDaliAnimationSetEndActioN(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( targetPosition, actor.GetCurrentPosition(), TEST_LOCATION ); + DALI_TEST_EQUALS( targetPosition, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); // Go back to the start actor.SetPosition(Vector3::ZERO); application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( Vector3::ZERO, actor.GetCurrentPosition(), TEST_LOCATION ); + DALI_TEST_EQUALS( Vector3::ZERO, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); // Test BakeFinal, animate again, for half the duration finishCheck.Reset(); @@ -815,17 +867,17 @@ int UtcDaliAnimationSetEndActioN(void) // We did NOT expect the animation to finish application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( targetPosition * 0.5f, actor.GetCurrentPosition(), VECTOR4_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( targetPosition * 0.5f, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), VECTOR4_EPSILON, TEST_LOCATION ); // The position should be same with target position in the next frame application.Render(0); - DALI_TEST_EQUALS( targetPosition, actor.GetCurrentPosition(), TEST_LOCATION ); + DALI_TEST_EQUALS( targetPosition, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); // Go back to the start actor.SetPosition(Vector3::ZERO); application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( Vector3::ZERO, actor.GetCurrentPosition(), TEST_LOCATION ); + DALI_TEST_EQUALS( Vector3::ZERO, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); // Test EndAction::Discard, animate again, but don't bake this time finishCheck.Reset(); @@ -839,17 +891,17 @@ int UtcDaliAnimationSetEndActioN(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( targetPosition, actor.GetCurrentPosition(), TEST_LOCATION ); + DALI_TEST_EQUALS( targetPosition, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); // The position should be discarded in the next frame application.Render(0); - DALI_TEST_EQUALS( Vector3::ZERO/*discarded*/, actor.GetCurrentPosition(), TEST_LOCATION ); + DALI_TEST_EQUALS( Vector3::ZERO/*discarded*/, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_EQUALS( Vector3::ZERO, actor.GetCurrentPosition(), TEST_LOCATION ); + DALI_TEST_EQUALS( Vector3::ZERO, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( Vector3::ZERO, actor.GetCurrentPosition(), TEST_LOCATION ); + DALI_TEST_EQUALS( Vector3::ZERO, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); END_TEST; } @@ -898,7 +950,7 @@ int UtcDaliAnimationSetDisconnectActionP(void) application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); } // Bake @@ -925,7 +977,7 @@ int UtcDaliAnimationSetDisconnectActionP(void) application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition*0.5f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition*0.5f, TEST_LOCATION ); } // Discard @@ -952,7 +1004,7 @@ int UtcDaliAnimationSetDisconnectActionP(void) application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3::ZERO, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION ); } // Don't play the animation: disconnect action should not be applied @@ -975,7 +1027,7 @@ int UtcDaliAnimationSetDisconnectActionP(void) application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3::ZERO, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION ); } END_TEST; @@ -1059,7 +1111,7 @@ int UtcDaliAnimationSetCurrentProgressP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), (targetPosition * 0.6f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), (targetPosition * 0.6f), TEST_LOCATION ); DALI_TEST_EQUALS( 0.6f, animation.GetCurrentProgress(), TEST_LOCATION ); animation.Play(); // Test that calling play has no effect, when animation is already playing @@ -1073,20 +1125,20 @@ int UtcDaliAnimationSetCurrentProgressP(void) application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), (targetPosition * 0.8f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), (targetPosition * 0.8f), TEST_LOCATION ); DALI_TEST_EQUALS( 0.8f, animation.GetCurrentProgress(), TEST_LOCATION ); application.Render(static_cast(durationSeconds*200.0f) + 1u/*just beyond the animation duration*/); // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_EQUALS( targetPosition, actor.GetCurrentPosition(), TEST_LOCATION ); + DALI_TEST_EQUALS( targetPosition, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( targetPosition, actor.GetCurrentPosition(), TEST_LOCATION ); + DALI_TEST_EQUALS( targetPosition, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); END_TEST; } @@ -1226,27 +1278,27 @@ int UtcDaliAnimationSetSpeedFactorP1(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), (targetPosition * 0.4f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), (targetPosition * 0.4f), TEST_LOCATION ); application.Render(static_cast(durationSeconds*200.0f)/* 80% progress */); // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), (targetPosition * 0.8f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), (targetPosition * 0.8f), TEST_LOCATION ); application.Render(static_cast(durationSeconds*100.0f) + 1u/*just beyond half the duration*/); // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_EQUALS( targetPosition, actor.GetCurrentPosition(), TEST_LOCATION ); + DALI_TEST_EQUALS( targetPosition, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( targetPosition, actor.GetCurrentPosition(), TEST_LOCATION ); + DALI_TEST_EQUALS( targetPosition, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); END_TEST; } @@ -1286,41 +1338,41 @@ int UtcDaliAnimationSetSpeedFactorP2(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), (targetPosition * 0.8f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), (targetPosition * 0.8f), TEST_LOCATION ); application.Render(static_cast(durationSeconds*200.0f)/* 60% progress */); // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), (targetPosition * 0.6f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), (targetPosition * 0.6f), TEST_LOCATION ); application.Render(static_cast(durationSeconds*200.0f)/* 40% progress */); // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), (targetPosition * 0.4f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), (targetPosition * 0.4f), TEST_LOCATION ); application.Render(static_cast(durationSeconds*200.0f)/* 20% progress */); // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), (targetPosition * 0.2f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), (targetPosition * 0.2f), TEST_LOCATION ); application.Render(static_cast(durationSeconds*200.0f) + 1u/*just beyond the animation duration*/); // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), initialPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), initialPosition, TEST_LOCATION ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_EQUALS( initialPosition, actor.GetCurrentPosition(), TEST_LOCATION ); + DALI_TEST_EQUALS( initialPosition, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( initialPosition, actor.GetCurrentPosition(), TEST_LOCATION ); + DALI_TEST_EQUALS( initialPosition, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); END_TEST; } @@ -1362,21 +1414,21 @@ int UtcDaliAnimationSetSpeedFactorP3(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), (targetPosition * 0.1f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), (targetPosition * 0.1f), TEST_LOCATION ); application.Render(static_cast(durationSeconds*200.0f)/* 20% progress */); // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), (targetPosition * 0.2f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), (targetPosition * 0.2f), TEST_LOCATION ); application.Render(static_cast(durationSeconds*200.0f)/* 30% progress */); // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), (targetPosition * 0.3f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), (targetPosition * 0.3f), TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*200.0f)/* 40% progress */); @@ -1384,20 +1436,20 @@ int UtcDaliAnimationSetSpeedFactorP3(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), (targetPosition * 0.4f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), (targetPosition * 0.4f), TEST_LOCATION ); application.Render(static_cast(durationSeconds*1200.0f) + 1u/*just beyond the animation duration*/); // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_EQUALS( targetPosition, actor.GetCurrentPosition(), TEST_LOCATION ); + DALI_TEST_EQUALS( targetPosition, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( targetPosition, actor.GetCurrentPosition(), TEST_LOCATION ); + DALI_TEST_EQUALS( targetPosition, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); END_TEST; } @@ -1440,21 +1492,21 @@ int UtcDaliAnimationSetSpeedFactorP4(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), (targetPosition * 0.1f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), (targetPosition * 0.1f), TEST_LOCATION ); application.Render(static_cast(durationSeconds*200.0f)/* 20% progress */); // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), (targetPosition * 0.2f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), (targetPosition * 0.2f), TEST_LOCATION ); application.Render(static_cast(durationSeconds*200.0f)/* 30% progress */); // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), (targetPosition * 0.3f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), (targetPosition * 0.3f), TEST_LOCATION ); tet_printf("Reverse direction of animation whilst playing\n"); tet_printf("SetSpeedFactor(-0.5f)\n"); @@ -1466,27 +1518,27 @@ int UtcDaliAnimationSetSpeedFactorP4(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), (targetPosition * 0.2f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), (targetPosition * 0.2f), TEST_LOCATION ); application.Render(static_cast(durationSeconds*200.0f)/* 10% progress */); // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), (targetPosition * 0.1f), 0.0001, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), (targetPosition * 0.1f), 0.0001, TEST_LOCATION ); application.Render(static_cast(durationSeconds*200.0f) + 1u/*just beyond the animation duration*/); // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), initialPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), initialPosition, TEST_LOCATION ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_EQUALS( initialPosition, actor.GetCurrentPosition(), TEST_LOCATION ); + DALI_TEST_EQUALS( initialPosition, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( initialPosition, actor.GetCurrentPosition(), TEST_LOCATION ); + DALI_TEST_EQUALS( initialPosition, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); END_TEST; } @@ -1646,8 +1698,8 @@ int UtcDaliAnimationSetSpeedFactorAndRange(void) unsigned int actorIndex = 0u; for( actorIndex = 0u; actorIndex < NUM_ENTRIES; ++actorIndex ) { - DALI_TEST_EQUALS( actors[actorIndex].GetCurrentPosition().x, testData[actorIndex].expected[frame], 0.001, TEST_LOCATION ); - if( ! Equals(actors[actorIndex].GetCurrentPosition().x, testData[actorIndex].expected[frame]) ) + DALI_TEST_EQUALS( actors[actorIndex].GetCurrentProperty< Vector3 >( Actor::Property::POSITION ).x, testData[actorIndex].expected[frame], 0.001, TEST_LOCATION ); + if( ! Equals(actors[actorIndex].GetCurrentProperty< Vector3 >( Actor::Property::POSITION ).x, testData[actorIndex].expected[frame]) ) { tet_printf("Failed at frame %u, actorIndex %u\n", frame, actorIndex ); } @@ -1733,7 +1785,7 @@ int UtcDaliAnimationSetSpeedFactorRangeAndLoopCount01(void) for( unsigned int frame = 0; frame < NUM_FRAMES; ++frame ) { - DALI_TEST_EQUALS( actor.GetCurrentPosition().x, testData.expected[frame], 0.001, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ).x, testData.expected[frame], 0.001, TEST_LOCATION ); application.Render(200); // 200 ms at half speed corresponds to 0.1 s @@ -1748,7 +1800,7 @@ int UtcDaliAnimationSetSpeedFactorRangeAndLoopCount01(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition().x, 80.0f, 0.001, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ).x, 80.0f, 0.001, TEST_LOCATION ); END_TEST; } @@ -1815,7 +1867,7 @@ int UtcDaliAnimationSetSpeedFactorRangeAndLoopCount02(void) for( unsigned int frame = 0; frame < NUM_FRAMES; ++frame ) { - DALI_TEST_EQUALS( actor.GetCurrentPosition().x, testData.expected[frame], 0.001, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ).x, testData.expected[frame], 0.001, TEST_LOCATION ); application.Render(200); // 200 ms at half speed corresponds to 0.1 s @@ -1830,7 +1882,7 @@ int UtcDaliAnimationSetSpeedFactorRangeAndLoopCount02(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition().x, 30.0f, 0.001, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ).x, 30.0f, 0.001, TEST_LOCATION ); END_TEST; } @@ -1882,14 +1934,14 @@ int UtcDaliAnimationSetPlayRangeP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), ( targetPosition * 0.6f ), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), ( targetPosition * 0.6f ), TEST_LOCATION ); application.SendNotification(); application.Render( static_cast< unsigned int >( durationSeconds * 200.0f )/* 80% progress */ ); application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), ( targetPosition * 0.8f ), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), ( targetPosition * 0.8f ), TEST_LOCATION ); application.SendNotification(); application.Render( static_cast< unsigned int >( durationSeconds*100.0f ) + 1u/*just beyond the animation duration*/ ); @@ -1897,7 +1949,7 @@ int UtcDaliAnimationSetPlayRangeP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), ( targetPosition * 0.9f ), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), ( targetPosition * 0.9f ), TEST_LOCATION ); END_TEST; } @@ -1976,7 +2028,7 @@ int UtcDaliAnimationPlayP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), (targetPosition * 0.2f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), (targetPosition * 0.2f), TEST_LOCATION ); animation.Play(); // Test that calling play has no effect, when animation is already playing application.SendNotification(); @@ -1985,7 +2037,7 @@ int UtcDaliAnimationPlayP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), (targetPosition * 0.4f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), (targetPosition * 0.4f), TEST_LOCATION ); animation.Play(); // Test that calling play has no effect, when animation is already playing application.SendNotification(); @@ -1994,7 +2046,7 @@ int UtcDaliAnimationPlayP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), (targetPosition * 0.6f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), (targetPosition * 0.6f), TEST_LOCATION ); animation.Play(); // Test that calling play has no effect, when animation is already playing application.SendNotification(); @@ -2003,7 +2055,7 @@ int UtcDaliAnimationPlayP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), (targetPosition * 0.8f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), (targetPosition * 0.8f), TEST_LOCATION ); animation.Play(); // Test that calling play has no effect, when animation is already playing application.SendNotification(); @@ -2012,17 +2064,17 @@ int UtcDaliAnimationPlayP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_EQUALS( targetPosition, actor.GetCurrentPosition(), TEST_LOCATION ); + DALI_TEST_EQUALS( targetPosition, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( targetPosition, actor.GetCurrentPosition(), TEST_LOCATION ); + DALI_TEST_EQUALS( targetPosition, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); END_TEST; } -int UtcDaliAnimationPlayOffStageP(void) +int UtcDaliAnimationPlayOffStageDiscardP(void) { // Test that an animation can be played, when the actor is off-stage. // When the actor is added to the stage, it should appear at the current position @@ -2032,8 +2084,8 @@ int UtcDaliAnimationPlayOffStageP(void) Actor actor = Actor::New(); Vector3 basePosition(Vector3::ZERO); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), basePosition, TEST_LOCATION ); - // Not added to the stage! + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), basePosition, TEST_LOCATION ); + // Not added to the stage yet! // Build the animation float durationSeconds(1.0f); @@ -2055,7 +2107,99 @@ int UtcDaliAnimationPlayOffStageP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3::ZERO/*off-stage*/, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(20,20,20), TEST_LOCATION ); + + // Add to the stage + Stage::GetCurrent().Add(actor); + + application.SendNotification(); + application.Render(static_cast(durationSeconds*200.0f)/* 40% progress */); + + // We didn't expect the animation to finish yet + application.SendNotification(); + finishCheck.CheckSignalNotReceived(); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(40,40,40)/*on-stage*/, TEST_LOCATION ); + + // Remove from the stage + Stage::GetCurrent().Remove(actor); + + application.SendNotification(); + application.Render(static_cast(durationSeconds*200.0f)/* 60% progress */); + + // We didn't expect the animation to finish yet + application.SendNotification(); + finishCheck.CheckSignalNotReceived(); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO/*back to start position as disconnect behaviour is discard*/, TEST_LOCATION ); + // Check that nothing has changed after a couple of buffer swaps + application.Render(0); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION ); + application.Render(0); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION ); + application.Render(0); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION ); + + // Add to the stage + Stage::GetCurrent().Add(actor); + + application.SendNotification(); + application.Render(static_cast(durationSeconds*200.0f)/* 80% progress */); + + // We didn't expect the animation to finish yet + application.SendNotification(); + finishCheck.CheckSignalNotReceived(); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(80,80,80), TEST_LOCATION ); + + application.SendNotification(); + application.Render(static_cast(durationSeconds*200.0f) + 1u/*just beyond the animation duration*/); + + // We did expect the animation to finish + application.SendNotification(); + finishCheck.CheckSignalReceived(); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); + + // Check that nothing has changed after a couple of buffer swaps + application.Render(0); + DALI_TEST_EQUALS( targetPosition, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); + + + application.Render(0); + DALI_TEST_EQUALS( targetPosition, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); + END_TEST; +} + +int UtcDaliAnimationPlayOffStageBakeFinalP(void) +{ + // Test that an animation can be played, when the actor is off-stage. + // When the actor is added to the stage, it should appear at the current position + // i.e. where it would have been anyway, if on-stage from the beginning. + + TestApplication application; + + Actor actor = Actor::New(); + Vector3 basePosition(Vector3::ZERO); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), basePosition, TEST_LOCATION ); + // Not added to the stage! + + // Build the animation + float durationSeconds(1.0f); + Animation animation = Animation::New(durationSeconds); + Vector3 targetPosition(100.0f, 100.0f, 100.0f); + animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR); + + // Start the animation + animation.Play(); + + bool signalReceived(false); + AnimationFinishCheck finishCheck(signalReceived); + animation.FinishedSignal().Connect(&application, finishCheck); + + application.SendNotification(); + application.Render(static_cast(durationSeconds*200.0f)/* 20% progress */); + + // We didn't expect the animation to finish yet + application.SendNotification(); + finishCheck.CheckSignalNotReceived(); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(20,20,20), TEST_LOCATION ); // Add to the stage Stage::GetCurrent().Add(actor); @@ -2066,8 +2210,7 @@ int UtcDaliAnimationPlayOffStageP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - Vector3 expectedPosition(basePosition + (targetPosition - basePosition)*0.4f); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), expectedPosition/*on-stage*/, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(40,40,40)/*on-stage*/, TEST_LOCATION ); // Remove from the stage Stage::GetCurrent().Remove(actor); @@ -2078,19 +2221,123 @@ int UtcDaliAnimationPlayOffStageP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3::ZERO/*back to start position*/, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition /*bake final*/, TEST_LOCATION ); + + // Add to the stage + Stage::GetCurrent().Add(actor); + + application.SendNotification(); + application.Render(static_cast(durationSeconds*200.0f)/* 80% progress */); + + // We didn't expect the animation to finish yet + application.SendNotification(); + finishCheck.CheckSignalNotReceived(); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition /*bake final removed the */, TEST_LOCATION ); + + application.SendNotification(); + application.Render(static_cast(durationSeconds*200.0f) + 1u/*just beyond the animation duration*/); + + // We did expect the animation to finish + application.SendNotification(); + finishCheck.CheckSignalReceived(); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); + + // Check that nothing has changed after a couple of buffer swaps + application.Render(0); + DALI_TEST_EQUALS( targetPosition, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); + + application.Render(0); + DALI_TEST_EQUALS( targetPosition, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); + END_TEST; +} + +int UtcDaliAnimationPlayOffStageBakeP(void) +{ + // Test that an animation can be played, when the actor is off-stage. + // When the actor is added to the stage, it should appear at the current position + // i.e. where it would have been anyway, if on-stage from the beginning. + + TestApplication application; + + Actor actor = Actor::New(); + Vector3 basePosition(Vector3::ZERO); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), basePosition, TEST_LOCATION ); + // Not added to the stage! + + // Build the animation + float durationSeconds(1.0f); + Animation animation = Animation::New(durationSeconds); + animation.SetDisconnectAction( Animation::Bake ); + Vector3 targetPosition(100.0f, 100.0f, 100.0f); + animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR); + + // Start the animation + animation.Play(); + + bool signalReceived(false); + AnimationFinishCheck finishCheck(signalReceived); + animation.FinishedSignal().Connect(&application, finishCheck); + + application.SendNotification(); + application.Render(static_cast(durationSeconds*200.0f)/* 20% progress */); + + // We didn't expect the animation to finish yet + application.SendNotification(); + finishCheck.CheckSignalNotReceived(); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(20,20,20), TEST_LOCATION ); // Add to the stage Stage::GetCurrent().Add(actor); application.SendNotification(); + application.Render(static_cast(durationSeconds*200.0f)/* 40% progress */); + + // We didn't expect the animation to finish yet + application.SendNotification(); + finishCheck.CheckSignalNotReceived(); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(40,40,40)/*on-stage*/, TEST_LOCATION ); + + // Remove from the stage + Stage::GetCurrent().Remove(actor); // baked here + + application.SendNotification(); + // this render is a no-op in this case as animator is disabled while off stage + application.Render(static_cast(durationSeconds*200.0f)/* 60% progress */); + // We didn't expect the animation to finish yet + application.SendNotification(); + finishCheck.CheckSignalNotReceived(); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(40,40,40) /*baked value*/, TEST_LOCATION ); + + // Add back to the stage + Stage::GetCurrent().Add(actor); + + application.SendNotification(); application.Render(static_cast(durationSeconds*200.0f)/* 80% progress */); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(88,88,88) /* animation restarted at 40,40,40 + 80%*60 */, TEST_LOCATION ); + application.Render(static_cast(0.0f) ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(88,88,88) /*baked value*/, TEST_LOCATION ); + application.Render(static_cast(0.0f) ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(88,88,88) /*baked value*/, TEST_LOCATION ); + + // Remove from the stage + Stage::GetCurrent().Remove(actor); // baked here + + application.SendNotification(); + // this render is a no-op in this case as animator is disabled while off stage + application.Render(static_cast(durationSeconds*200.0f)/* 100% progress */); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(88,88,88) /*baked value*/, TEST_LOCATION ); + application.Render(static_cast(0.0f) ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(88,88,88) /*baked value*/, TEST_LOCATION ); + application.Render(static_cast(0.0f) ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(88,88,88) /*baked value*/, TEST_LOCATION ); + + // Add back to the stage + Stage::GetCurrent().Add(actor); // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - expectedPosition = Vector3(basePosition + (targetPosition - basePosition)*0.8f); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), expectedPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(88,88,88) , TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*200.0f) + 1u/*just beyond the animation duration*/); @@ -2098,13 +2345,14 @@ int UtcDaliAnimationPlayOffStageP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_EQUALS( targetPosition, actor.GetCurrentPosition(), TEST_LOCATION ); + DALI_TEST_EQUALS( targetPosition, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); + application.Render(0); - DALI_TEST_EQUALS( targetPosition, actor.GetCurrentPosition(), TEST_LOCATION ); + DALI_TEST_EQUALS( targetPosition, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); END_TEST; } @@ -2139,7 +2387,7 @@ int UtcDaliAnimationPlayDiscardHandleP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), (targetPosition * 0.2f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), (targetPosition * 0.2f), TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*200.0f)/* 40% progress */); @@ -2147,7 +2395,7 @@ int UtcDaliAnimationPlayDiscardHandleP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), (targetPosition * 0.4f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), (targetPosition * 0.4f), TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*200.0f)/* 60% progress */); @@ -2155,7 +2403,7 @@ int UtcDaliAnimationPlayDiscardHandleP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), (targetPosition * 0.6f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), (targetPosition * 0.6f), TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*200.0f)/* 80% progress */); @@ -2163,7 +2411,7 @@ int UtcDaliAnimationPlayDiscardHandleP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), (targetPosition * 0.8f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), (targetPosition * 0.8f), TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*200.0f) + 1u/*just beyond the animation duration*/); @@ -2171,13 +2419,13 @@ int UtcDaliAnimationPlayDiscardHandleP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_EQUALS( targetPosition, actor.GetCurrentPosition(), TEST_LOCATION ); + DALI_TEST_EQUALS( targetPosition, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( targetPosition, actor.GetCurrentPosition(), TEST_LOCATION ); + DALI_TEST_EQUALS( targetPosition, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); END_TEST; } @@ -2207,7 +2455,7 @@ int UtcDaliAnimationPlayStopDiscardHandleP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), (targetPosition * 0.2f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), (targetPosition * 0.2f), TEST_LOCATION ); // This is a test of the "Fire and Forget" behaviour // Stop the animation, and Discard the animation handle! @@ -2222,7 +2470,7 @@ int UtcDaliAnimationPlayStopDiscardHandleP(void) application.SendNotification(); finishCheck.CheckSignalReceived(); finishCheck.Reset(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), (targetPosition * 0.2f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), (targetPosition * 0.2f), TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*200.0f)/* 60% progress */); @@ -2230,7 +2478,7 @@ int UtcDaliAnimationPlayStopDiscardHandleP(void) // Check that nothing has changed application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), (targetPosition * 0.2f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), (targetPosition * 0.2f), TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*200.0f)/* 80% progress */); @@ -2238,7 +2486,7 @@ int UtcDaliAnimationPlayStopDiscardHandleP(void) // Check that nothing has changed application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), (targetPosition * 0.2f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), (targetPosition * 0.2f), TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*200.0f)/* 100% progress */); @@ -2246,7 +2494,7 @@ int UtcDaliAnimationPlayStopDiscardHandleP(void) // Check that nothing has changed application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), (targetPosition * 0.2f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), (targetPosition * 0.2f), TEST_LOCATION ); END_TEST; } @@ -2291,7 +2539,7 @@ int UtcDaliAnimationPlayRangeP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), (targetPosition * 0.6f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), (targetPosition * 0.6f), TEST_LOCATION ); animation.Play(); // Test that calling play has no effect, when animation is already playing application.SendNotification(); @@ -2300,13 +2548,13 @@ int UtcDaliAnimationPlayRangeP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), (targetPosition * 0.8f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), (targetPosition * 0.8f), TEST_LOCATION ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_EQUALS( targetPosition * 0.8f, actor.GetCurrentPosition(), TEST_LOCATION ); + DALI_TEST_EQUALS( targetPosition * 0.8f, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( targetPosition * 0.8f, actor.GetCurrentPosition(), TEST_LOCATION ); + DALI_TEST_EQUALS( targetPosition * 0.8f, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); //Loop inside the range @@ -2326,7 +2574,7 @@ int UtcDaliAnimationPlayRangeP(void) progress = progress - 0.4f; } - DALI_TEST_EQUALS( targetPosition*progress, actor.GetCurrentPosition(), 0.001f, TEST_LOCATION ); + DALI_TEST_EQUALS( targetPosition*progress, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), 0.001f, TEST_LOCATION ); } // We didn't expect the animation to finish yet @@ -2348,7 +2596,7 @@ int UtcDaliAnimationPlayRangeP(void) progress = progress - 0.7f; } - DALI_TEST_EQUALS( targetPosition*progress, actor.GetCurrentPosition(), 0.001f, TEST_LOCATION ); + DALI_TEST_EQUALS( targetPosition*progress, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), 0.001f, TEST_LOCATION ); } END_TEST; @@ -2361,6 +2609,8 @@ int UtcDaliAnimationPlayFromP(void) Actor actor = Actor::New(); Stage::GetCurrent().Add(actor); + DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION ); + // Build the animation float durationSeconds(1.0f); Animation animation = Animation::New(durationSeconds); @@ -2370,6 +2620,9 @@ int UtcDaliAnimationPlayFromP(void) // Start the animation from 40% progress animation.PlayFrom( 0.4f ); + // Target value should be updated straight away + DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); + bool signalReceived(false); AnimationFinishCheck finishCheck(signalReceived); animation.FinishedSignal().Connect(&application, finishCheck); @@ -2380,7 +2633,7 @@ int UtcDaliAnimationPlayFromP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), (targetPosition * 0.6f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), (targetPosition * 0.6f), TEST_LOCATION ); animation.Play(); // Test that calling play has no effect, when animation is already playing application.SendNotification(); @@ -2389,19 +2642,19 @@ int UtcDaliAnimationPlayFromP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), (targetPosition * 0.8f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), (targetPosition * 0.8f), TEST_LOCATION ); application.Render(static_cast(durationSeconds*200.0f) + 1u/*just beyond the animation duration*/); // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_EQUALS( targetPosition, actor.GetCurrentPosition(), TEST_LOCATION ); + DALI_TEST_EQUALS( targetPosition, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( targetPosition, actor.GetCurrentPosition(), TEST_LOCATION ); + DALI_TEST_EQUALS( targetPosition, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); END_TEST; } @@ -2457,7 +2710,7 @@ int UtcDaliAnimationPauseP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), fiftyPercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), fiftyPercentProgress, TEST_LOCATION ); // Pause the animation animation.Pause(); @@ -2471,7 +2724,7 @@ int UtcDaliAnimationPauseP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), fiftyPercentProgress/* Still 50% progress when paused */, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), fiftyPercentProgress/* Still 50% progress when paused */, TEST_LOCATION ); } // Keep going @@ -2489,13 +2742,13 @@ int UtcDaliAnimationPauseP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_EQUALS( targetPosition, actor.GetCurrentPosition(), TEST_LOCATION ); + DALI_TEST_EQUALS( targetPosition, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( targetPosition, actor.GetCurrentPosition(), TEST_LOCATION ); + DALI_TEST_EQUALS( targetPosition, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); END_TEST; } @@ -2532,7 +2785,7 @@ int UtcDaliAnimationGetStateP(void) application.SendNotification(); finishCheck.CheckSignalNotReceived(); DALI_TEST_EQUALS( animation.GetState(), Animation::PLAYING, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), fiftyPercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), fiftyPercentProgress, TEST_LOCATION ); // Pause the animation animation.Pause(); @@ -2548,7 +2801,7 @@ int UtcDaliAnimationGetStateP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), fiftyPercentProgress/* Still 50% progress when paused */, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), fiftyPercentProgress/* Still 50% progress when paused */, TEST_LOCATION ); DALI_TEST_EQUALS( animation.GetState(), Animation::PAUSED, TEST_LOCATION ); } @@ -2569,14 +2822,14 @@ int UtcDaliAnimationGetStateP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); DALI_TEST_EQUALS( animation.GetState(), Animation::STOPPED, TEST_LOCATION ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_EQUALS( targetPosition, actor.GetCurrentPosition(), TEST_LOCATION ); + DALI_TEST_EQUALS( targetPosition, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( targetPosition, actor.GetCurrentPosition(), TEST_LOCATION ); + DALI_TEST_EQUALS( targetPosition, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); DALI_TEST_EQUALS( animation.GetState(), Animation::STOPPED, TEST_LOCATION ); // re-play @@ -2621,7 +2874,7 @@ int UtcDaliAnimationStopP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), fiftyPercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), fiftyPercentProgress, TEST_LOCATION ); // Stop the animation animation.Stop(); @@ -2635,7 +2888,7 @@ int UtcDaliAnimationStopP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), fiftyPercentProgress/* Still 50% progress when stopped */, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), fiftyPercentProgress/* Still 50% progress when stopped */, TEST_LOCATION ); } END_TEST; } @@ -2671,7 +2924,7 @@ int UtcDaliAnimationStopSetPositionP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), fiftyPercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), fiftyPercentProgress, TEST_LOCATION ); // Stop the animation animation.Stop(); @@ -2687,7 +2940,7 @@ int UtcDaliAnimationStopSetPositionP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), positionSet/*Animation should not interfere with this*/, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), positionSet/*Animation should not interfere with this*/, TEST_LOCATION ); } END_TEST; } @@ -2720,7 +2973,7 @@ int UtcDaliAnimationClearP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), fiftyPercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), fiftyPercentProgress, TEST_LOCATION ); // Clear the animation animation.Clear(); @@ -2731,7 +2984,7 @@ int UtcDaliAnimationClearP(void) // We don't expect the animation to finish now application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), fiftyPercentProgress/* Still 50% progress since the animator was destroyed */, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), fiftyPercentProgress/* Still 50% progress since the animator was destroyed */, TEST_LOCATION ); // Restart as a scale animation; this should not move the actor's position finishCheck.Reset(); @@ -2746,16 +2999,16 @@ int UtcDaliAnimationClearP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3::ZERO/*Check move-animator was destroyed*/, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetCurrentScale(), Vector3(2.0f, 2.0f, 2.0f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO/*Check move-animator was destroyed*/, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ), Vector3(2.0f, 2.0f, 2.0f), TEST_LOCATION ); application.Render(static_cast(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/); // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3::ZERO/*Check move-animator was destroyed*/, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetCurrentScale(), targetScale, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO/*Check move-animator was destroyed*/, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ), targetScale, TEST_LOCATION ); END_TEST; } @@ -2792,6 +3045,7 @@ int UtcDaliAnimationAnimateByBooleanP(void) Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); DALI_TEST_CHECK( actor.GetProperty(index) == startValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == startValue ); // Build the animation float durationSeconds(2.0f); @@ -2803,6 +3057,9 @@ int UtcDaliAnimationAnimateByBooleanP(void) // Start the animation animation.Play(); + // Target value should be retrievable straight away + DALI_TEST_EQUALS( actor.GetProperty< bool >( index ), finalValue, TEST_LOCATION ); + bool signalReceived(false); AnimationFinishCheck finishCheck(signalReceived); animation.FinishedSignal().Connect(&application, finishCheck); @@ -2813,7 +3070,7 @@ int UtcDaliAnimationAnimateByBooleanP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_CHECK( actor.GetProperty(index) == startValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == startValue ); application.SendNotification(); application.Render(static_cast(durationSeconds*50.0f) + 1u/*just beyond the animation duration*/); @@ -2821,13 +3078,13 @@ int UtcDaliAnimationAnimateByBooleanP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_CHECK( actor.GetProperty(index) == finalValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == finalValue ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_CHECK( actor.GetProperty(index) == finalValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == finalValue ); application.Render(0); - DALI_TEST_CHECK( actor.GetProperty(index) == finalValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == finalValue ); // Repeat with relative value "false" - this should be an NOOP animation = Animation::New(durationSeconds); @@ -2846,7 +3103,7 @@ int UtcDaliAnimationAnimateByBooleanP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_CHECK( actor.GetProperty(index) == finalValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == finalValue ); application.SendNotification(); application.Render(static_cast(durationSeconds*50.0f) + 1u/*just beyond the animation duration*/); @@ -2854,13 +3111,13 @@ int UtcDaliAnimationAnimateByBooleanP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_CHECK( actor.GetProperty(index) == finalValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == finalValue ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_CHECK( actor.GetProperty(index) == finalValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == finalValue ); application.Render(0); - DALI_TEST_CHECK( actor.GetProperty(index) == finalValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == finalValue ); END_TEST; } @@ -2875,6 +3132,7 @@ int UtcDaliAnimationAnimateByBooleanAlphaFunctionP(void) Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); DALI_TEST_CHECK( actor.GetProperty(index) == startValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == startValue ); // Build the animation float durationSeconds(2.0f); @@ -2896,7 +3154,7 @@ int UtcDaliAnimationAnimateByBooleanAlphaFunctionP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_CHECK( actor.GetProperty(index) == startValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == startValue ); application.SendNotification(); application.Render(static_cast(durationSeconds*50.0f) + 1u/*just beyond the animation duration*/); @@ -2904,13 +3162,13 @@ int UtcDaliAnimationAnimateByBooleanAlphaFunctionP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_CHECK( actor.GetProperty(index) == finalValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == finalValue ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_CHECK( actor.GetProperty(index) == finalValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == finalValue ); application.Render(0); - DALI_TEST_CHECK( actor.GetProperty(index) == finalValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == finalValue ); // Repeat with relative value "false" - this should be an NOOP animation = Animation::New(durationSeconds); @@ -2929,7 +3187,7 @@ int UtcDaliAnimationAnimateByBooleanAlphaFunctionP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_CHECK( actor.GetProperty(index) == finalValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == finalValue ); application.SendNotification(); application.Render(static_cast(durationSeconds*50.0f) + 1u/*just beyond the animation duration*/); @@ -2937,7 +3195,7 @@ int UtcDaliAnimationAnimateByBooleanAlphaFunctionP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_CHECK( actor.GetProperty(index) == finalValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == finalValue ); END_TEST; } @@ -2952,6 +3210,7 @@ int UtcDaliAnimationAnimateByBooleanTimePeriodP(void) Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); DALI_TEST_CHECK( actor.GetProperty(index) == startValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == startValue ); // Build the animation float durationSeconds(2.0f); @@ -2976,7 +3235,7 @@ int UtcDaliAnimationAnimateByBooleanTimePeriodP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_CHECK( actor.GetProperty(index) == startValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == startValue ); application.SendNotification(); application.Render(static_cast(animatorDurationSeconds*50.0f) + 1u/*just beyond the animator duration*/); @@ -2986,7 +3245,7 @@ int UtcDaliAnimationAnimateByBooleanTimePeriodP(void) finishCheck.CheckSignalNotReceived(); // ...however we should have reached the final value - DALI_TEST_CHECK( actor.GetProperty(index) == finalValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == finalValue ); application.SendNotification(); application.Render(static_cast(animatorDurationSeconds*1000.0f)/*just beyond the animation duration*/); @@ -2994,13 +3253,13 @@ int UtcDaliAnimationAnimateByBooleanTimePeriodP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_CHECK( actor.GetProperty(index) == finalValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == finalValue ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_CHECK( actor.GetProperty(index) == finalValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == finalValue ); application.Render(0); - DALI_TEST_CHECK( actor.GetProperty(index) == finalValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == finalValue ); END_TEST; } @@ -3015,6 +3274,7 @@ int UtcDaliAnimationAnimateByBooleanAlphaFunctionTimePeriodP(void) Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); DALI_TEST_CHECK( actor.GetProperty(index) == startValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == startValue ); // Build the animation float durationSeconds(2.0f); @@ -3040,7 +3300,7 @@ int UtcDaliAnimationAnimateByBooleanAlphaFunctionTimePeriodP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_CHECK( actor.GetProperty(index) == startValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == startValue ); application.SendNotification(); application.Render(static_cast(animatorDurationSeconds*50.0f) + 1u/*just beyond the animator duration*/); @@ -3050,7 +3310,7 @@ int UtcDaliAnimationAnimateByBooleanAlphaFunctionTimePeriodP(void) finishCheck.CheckSignalNotReceived(); // ...however we should have reached the final value - DALI_TEST_CHECK( actor.GetProperty(index) == finalValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == finalValue ); application.SendNotification(); application.Render(static_cast(animatorDurationSeconds*1000.0f)/*just beyond the animation duration*/); @@ -3058,13 +3318,13 @@ int UtcDaliAnimationAnimateByBooleanAlphaFunctionTimePeriodP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_CHECK( actor.GetProperty(index) == finalValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == finalValue ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_CHECK( actor.GetProperty(index) == finalValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == finalValue ); application.Render(0); - DALI_TEST_CHECK( actor.GetProperty(index) == finalValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == finalValue ); END_TEST; } @@ -3079,6 +3339,7 @@ int UtcDaliAnimationAnimateByFloatP(void) Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( index ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(2.0f); @@ -3092,6 +3353,9 @@ int UtcDaliAnimationAnimateByFloatP(void) // Start the animation animation.Play(); + // Target value should be retrievable straight away + DALI_TEST_EQUALS( actor.GetProperty< float >( index ), targetValue, TEST_LOCATION ); + bool signalReceived(false); AnimationFinishCheck finishCheck(signalReceived); animation.FinishedSignal().Connect(&application, finishCheck); @@ -3102,7 +3366,7 @@ int UtcDaliAnimationAnimateByFloatP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), ninetyFivePercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( index ), ninetyFivePercentProgress, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*50.0f) + 1u/*just beyond the animation duration*/); @@ -3110,13 +3374,13 @@ int UtcDaliAnimationAnimateByFloatP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( index ), targetValue, TEST_LOCATION ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( index ), targetValue, TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( index ), targetValue, TEST_LOCATION ); END_TEST; } @@ -3131,6 +3395,7 @@ int UtcDaliAnimationAnimateByFloatAlphaFunctionP(void) Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( index ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -3156,7 +3421,7 @@ int UtcDaliAnimationAnimateByFloatAlphaFunctionP(void) finishCheck.CheckSignalNotReceived(); // The position should have moved more, than with a linear alpha function - float current(actor.GetProperty(index)); + float current( actor.GetCurrentProperty< float >( index ) ); DALI_TEST_CHECK( current > ninetyFivePercentProgress ); application.SendNotification(); @@ -3165,13 +3430,13 @@ int UtcDaliAnimationAnimateByFloatAlphaFunctionP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( index ), targetValue, TEST_LOCATION ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( index ), targetValue, TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( index ), targetValue, TEST_LOCATION ); END_TEST; } @@ -3186,6 +3451,7 @@ int UtcDaliAnimationAnimateByFloatTimePeriodP(void) Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( index ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -3210,7 +3476,7 @@ int UtcDaliAnimationAnimateByFloatTimePeriodP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( index ), startValue, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f)/* 75% animation progress, 50% animator progress */); @@ -3218,7 +3484,7 @@ int UtcDaliAnimationAnimateByFloatTimePeriodP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), startValue+(relativeValue*0.5f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( index ), startValue+(relativeValue*0.5f), TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/); @@ -3226,13 +3492,13 @@ int UtcDaliAnimationAnimateByFloatTimePeriodP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( index ), targetValue, TEST_LOCATION ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( index ), targetValue, TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( index ), targetValue, TEST_LOCATION ); END_TEST; } @@ -3247,6 +3513,7 @@ int UtcDaliAnimationAnimateByFloatAlphaFunctionTimePeriodP(void) Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( index ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -3272,7 +3539,7 @@ int UtcDaliAnimationAnimateByFloatAlphaFunctionTimePeriodP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( index ), startValue, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f)/* 75% animation progress, 50% animator progress */); @@ -3280,7 +3547,7 @@ int UtcDaliAnimationAnimateByFloatAlphaFunctionTimePeriodP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), startValue+(relativeValue*0.5f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( index ), startValue+(relativeValue*0.5f), TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/); @@ -3288,13 +3555,13 @@ int UtcDaliAnimationAnimateByFloatAlphaFunctionTimePeriodP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( index ), targetValue, TEST_LOCATION ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( index ), targetValue, TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( index ), targetValue, TEST_LOCATION ); END_TEST; } @@ -3309,6 +3576,7 @@ int UtcDaliAnimationAnimateByIntegerP(void) Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< int >( index ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(2.0f); @@ -3322,6 +3590,9 @@ int UtcDaliAnimationAnimateByIntegerP(void) // Start the animation animation.Play(); + // Target value should be retrievable straight away + DALI_TEST_EQUALS( actor.GetProperty< int >( index ), targetValue, TEST_LOCATION ); + bool signalReceived(false); AnimationFinishCheck finishCheck(signalReceived); animation.FinishedSignal().Connect(&application, finishCheck); @@ -3332,7 +3603,7 @@ int UtcDaliAnimationAnimateByIntegerP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), ninetyFivePercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< int >( index ), ninetyFivePercentProgress, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*50.0f) + 1u/*just beyond the animation duration*/); @@ -3340,13 +3611,13 @@ int UtcDaliAnimationAnimateByIntegerP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< int >( index ), targetValue, TEST_LOCATION ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< int >( index ), targetValue, TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< int >( index ), targetValue, TEST_LOCATION ); END_TEST; } @@ -3361,6 +3632,7 @@ int UtcDaliAnimationAnimateByIntegerAlphaFunctionP(void) Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< int >( index ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -3386,7 +3658,7 @@ int UtcDaliAnimationAnimateByIntegerAlphaFunctionP(void) finishCheck.CheckSignalNotReceived(); // The position should have moved more, than with a linear alpha function - int current(actor.GetProperty(index)); + int current( actor.GetCurrentProperty< int >( index ) ); DALI_TEST_CHECK( current > ninetyFivePercentProgress ); application.SendNotification(); @@ -3395,13 +3667,13 @@ int UtcDaliAnimationAnimateByIntegerAlphaFunctionP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< int >( index ), targetValue, TEST_LOCATION ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< int >( index ), targetValue, TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< int >( index ), targetValue, TEST_LOCATION ); END_TEST; } @@ -3416,6 +3688,7 @@ int UtcDaliAnimationAnimateByIntegerTimePeriodP(void) Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< int >( index ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -3440,7 +3713,7 @@ int UtcDaliAnimationAnimateByIntegerTimePeriodP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< int >( index ), startValue, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f)/* 75% animation progress, 50% animator progress */); @@ -3448,7 +3721,7 @@ int UtcDaliAnimationAnimateByIntegerTimePeriodP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), static_cast(startValue+(relativeValue*0.5f)+0.5f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< int >( index ), static_cast(startValue+(relativeValue*0.5f)+0.5f), TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/); @@ -3456,13 +3729,13 @@ int UtcDaliAnimationAnimateByIntegerTimePeriodP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< int >( index ), targetValue, TEST_LOCATION ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< int >( index ), targetValue, TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< int >( index ), targetValue, TEST_LOCATION ); END_TEST; } @@ -3477,6 +3750,7 @@ int UtcDaliAnimationAnimateByIntegerAlphaFunctionTimePeriodP(void) Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< int >( index ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -3502,7 +3776,7 @@ int UtcDaliAnimationAnimateByIntegerAlphaFunctionTimePeriodP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< int >( index ), startValue, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f)/* 75% animation progress, 50% animator progress */); @@ -3510,7 +3784,7 @@ int UtcDaliAnimationAnimateByIntegerAlphaFunctionTimePeriodP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), static_cast(startValue+(relativeValue*0.5f)+0.5f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< int >( index ), static_cast(startValue+(relativeValue*0.5f)+0.5f), TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/); @@ -3518,13 +3792,51 @@ int UtcDaliAnimationAnimateByIntegerAlphaFunctionTimePeriodP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< int >( index ), targetValue, TEST_LOCATION ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< int >( index ), targetValue, TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< int >( index ), targetValue, TEST_LOCATION ); + END_TEST; +} + +int UtcDaliAnimationAnimateByQuaternionP(void) +{ + TestApplication application; + + Actor actor = Actor::New(); + + // Register a quaternion property + const Quaternion startValue( Degree( 90 ), Vector3::XAXIS ); + Property::Index index = actor.RegisterProperty( "testProperty", startValue ); + Stage::GetCurrent().Add(actor); + DALI_TEST_CHECK( actor.GetProperty< Quaternion >(index) == startValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< Quaternion >( index ) == startValue ); + + // Build the animation + float durationSeconds(2.0f); + Animation animation = Animation::New(durationSeconds); + const Quaternion relativeValue( Degree( 90 ), Vector3::ZAXIS ); + const Quaternion finalValue( startValue * relativeValue ); + animation.AnimateBy(Property(actor, index), relativeValue); + + DALI_TEST_CHECK( actor.GetProperty< Quaternion >(index) == startValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< Quaternion >( index ) == startValue ); + + // Start the animation + animation.Play(); + + // Target value should be retrievable straight away + DALI_TEST_CHECK( actor.GetProperty< Quaternion >(index) == finalValue ); + + application.SendNotification(); + application.Render( 2000 ); // animation complete + + DALI_TEST_CHECK( actor.GetProperty< Quaternion >(index) == finalValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< Quaternion >( index ) == finalValue ); + END_TEST; } @@ -3539,6 +3851,7 @@ int UtcDaliAnimationAnimateByVector2P(void) Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector2 >( index ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(2.0f); @@ -3552,6 +3865,9 @@ int UtcDaliAnimationAnimateByVector2P(void) // Start the animation animation.Play(); + // Target value should be retrievable straight away + DALI_TEST_EQUALS( actor.GetProperty< Vector2 >( index ), targetValue, TEST_LOCATION ); + bool signalReceived(false); AnimationFinishCheck finishCheck(signalReceived); animation.FinishedSignal().Connect(&application, finishCheck); @@ -3562,7 +3878,7 @@ int UtcDaliAnimationAnimateByVector2P(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), ninetyFivePercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector2 >( index ), ninetyFivePercentProgress, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*50.0f) + 1u/*just beyond the animation duration*/); @@ -3570,13 +3886,13 @@ int UtcDaliAnimationAnimateByVector2P(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector2 >( index ), targetValue, TEST_LOCATION ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector2 >( index ), targetValue, TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector2 >( index ), targetValue, TEST_LOCATION ); END_TEST; } @@ -3591,6 +3907,7 @@ int UtcDaliAnimationAnimateByVector2AlphaFunctionP(void) Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector2 >( index ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -3616,7 +3933,7 @@ int UtcDaliAnimationAnimateByVector2AlphaFunctionP(void) finishCheck.CheckSignalNotReceived(); // The position should have moved more, than with a linear alpha function - Vector2 current(actor.GetProperty(index)); + Vector2 current( actor.GetCurrentProperty< Vector2 >( index ) ); DALI_TEST_CHECK( current.x < ninetyFivePercentProgress.x ); DALI_TEST_CHECK( current.y < ninetyFivePercentProgress.y ); @@ -3626,13 +3943,13 @@ int UtcDaliAnimationAnimateByVector2AlphaFunctionP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector2 >( index ), targetValue, TEST_LOCATION ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector2 >( index ), targetValue, TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector2 >( index ), targetValue, TEST_LOCATION ); END_TEST; } @@ -3647,6 +3964,7 @@ int UtcDaliAnimationAnimateByVector2TimePeriodP(void) Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector2 >( index ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -3671,7 +3989,7 @@ int UtcDaliAnimationAnimateByVector2TimePeriodP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector2 >( index ), startValue, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f)/* 75% animation progress, 50% animator progress */); @@ -3679,7 +3997,7 @@ int UtcDaliAnimationAnimateByVector2TimePeriodP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), startValue+(relativeValue*0.5f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector2 >( index ), startValue+(relativeValue*0.5f), TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/); @@ -3687,13 +4005,13 @@ int UtcDaliAnimationAnimateByVector2TimePeriodP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector2 >( index ), targetValue, TEST_LOCATION ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector2 >( index ), targetValue, TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector2 >( index ), targetValue, TEST_LOCATION ); END_TEST; } @@ -3708,6 +4026,7 @@ int UtcDaliAnimationAnimateByVector2AlphaFunctionTimePeriodP(void) Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector2 >( index ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -3733,7 +4052,7 @@ int UtcDaliAnimationAnimateByVector2AlphaFunctionTimePeriodP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector2 >( index ), startValue, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f)/* 75% animation progress, 50% animator progress */); @@ -3741,7 +4060,7 @@ int UtcDaliAnimationAnimateByVector2AlphaFunctionTimePeriodP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), startValue+(relativeValue*0.5f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector2 >( index ), startValue+(relativeValue*0.5f), TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/); @@ -3749,13 +4068,13 @@ int UtcDaliAnimationAnimateByVector2AlphaFunctionTimePeriodP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector2 >( index ), targetValue, TEST_LOCATION ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector2 >( index ), targetValue, TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector2 >( index ), targetValue, TEST_LOCATION ); END_TEST; } @@ -3770,6 +4089,7 @@ int UtcDaliAnimationAnimateByVector3P(void) Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( index ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(2.0f); @@ -3783,6 +4103,9 @@ int UtcDaliAnimationAnimateByVector3P(void) // Start the animation animation.Play(); + // Target value should be retrievable straight away + DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( index ), targetValue, TEST_LOCATION ); + bool signalReceived(false); AnimationFinishCheck finishCheck(signalReceived); animation.FinishedSignal().Connect(&application, finishCheck); @@ -3793,7 +4116,7 @@ int UtcDaliAnimationAnimateByVector3P(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), ninetyFivePercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( index ), ninetyFivePercentProgress, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*50.0f) + 1u/*just beyond the animation duration*/); @@ -3801,13 +4124,13 @@ int UtcDaliAnimationAnimateByVector3P(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( index ), targetValue, TEST_LOCATION ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( index ), targetValue, TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( index ), targetValue, TEST_LOCATION ); END_TEST; } @@ -3822,6 +4145,7 @@ int UtcDaliAnimationAnimateByVector3AlphaFunctionP(void) Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( index ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -3847,7 +4171,7 @@ int UtcDaliAnimationAnimateByVector3AlphaFunctionP(void) finishCheck.CheckSignalNotReceived(); // The position should have moved more, than with a linear alpha function - Vector3 current(actor.GetProperty(index)); + Vector3 current(actor.GetCurrentProperty< Vector3 >( index )); DALI_TEST_CHECK( current.x < ninetyFivePercentProgress.x ); DALI_TEST_CHECK( current.y < ninetyFivePercentProgress.y ); DALI_TEST_CHECK( current.z < ninetyFivePercentProgress.z ); @@ -3858,13 +4182,13 @@ int UtcDaliAnimationAnimateByVector3AlphaFunctionP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( index ), targetValue, TEST_LOCATION ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( index ), targetValue, TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( index ), targetValue, TEST_LOCATION ); END_TEST; } @@ -3879,6 +4203,7 @@ int UtcDaliAnimationAnimateByVector3TimePeriodP(void) Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( index ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -3903,7 +4228,7 @@ int UtcDaliAnimationAnimateByVector3TimePeriodP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( index ), startValue, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f)/* 75% animation progress, 50% animator progress */); @@ -3911,7 +4236,7 @@ int UtcDaliAnimationAnimateByVector3TimePeriodP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), startValue+(relativeValue*0.5f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( index ), startValue+(relativeValue*0.5f), TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/); @@ -3919,13 +4244,13 @@ int UtcDaliAnimationAnimateByVector3TimePeriodP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( index ), targetValue, TEST_LOCATION ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( index ), targetValue, TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( index ), targetValue, TEST_LOCATION ); END_TEST; } @@ -3940,6 +4265,7 @@ int UtcDaliAnimationAnimateByVector3AlphaFunctionTimePeriodP(void) Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( index ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -3965,7 +4291,7 @@ int UtcDaliAnimationAnimateByVector3AlphaFunctionTimePeriodP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( index ), startValue, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f)/* 75% animation progress, 50% animator progress */); @@ -3973,7 +4299,7 @@ int UtcDaliAnimationAnimateByVector3AlphaFunctionTimePeriodP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), startValue+(relativeValue*0.5f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( index ), startValue+(relativeValue*0.5f), TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/); @@ -3981,13 +4307,13 @@ int UtcDaliAnimationAnimateByVector3AlphaFunctionTimePeriodP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( index ), targetValue, TEST_LOCATION ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( index ), targetValue, TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( index ), targetValue, TEST_LOCATION ); END_TEST; } @@ -4002,6 +4328,7 @@ int UtcDaliAnimationAnimateByVector4P(void) Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( index ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(2.0f); @@ -4015,6 +4342,9 @@ int UtcDaliAnimationAnimateByVector4P(void) // Start the animation animation.Play(); + // Target value should be retrievable straight away + DALI_TEST_EQUALS( actor.GetProperty< Vector4 >( index ), targetValue, TEST_LOCATION ); + bool signalReceived(false); AnimationFinishCheck finishCheck(signalReceived); animation.FinishedSignal().Connect(&application, finishCheck); @@ -4025,7 +4355,7 @@ int UtcDaliAnimationAnimateByVector4P(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), ninetyFivePercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( index ), ninetyFivePercentProgress, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*50.0f) + 1u/*just beyond the animation duration*/); @@ -4033,13 +4363,13 @@ int UtcDaliAnimationAnimateByVector4P(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( index ), targetValue, TEST_LOCATION ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( index ), targetValue, TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( index ), targetValue, TEST_LOCATION ); END_TEST; } @@ -4054,6 +4384,7 @@ int UtcDaliAnimationAnimateByVector4AlphaFunctionP(void) Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( index ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -4079,7 +4410,7 @@ int UtcDaliAnimationAnimateByVector4AlphaFunctionP(void) finishCheck.CheckSignalNotReceived(); // The position should have moved more, than with a linear alpha function - Vector4 current(actor.GetProperty(index)); + Vector4 current( actor.GetCurrentProperty< Vector4 >( index ) ); DALI_TEST_CHECK( current.x < ninetyFivePercentProgress.x ); DALI_TEST_CHECK( current.y < ninetyFivePercentProgress.y ); DALI_TEST_CHECK( current.z < ninetyFivePercentProgress.z ); @@ -4091,13 +4422,13 @@ int UtcDaliAnimationAnimateByVector4AlphaFunctionP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( index ), targetValue, TEST_LOCATION ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( index ), targetValue, TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( index ), targetValue, TEST_LOCATION ); END_TEST; } @@ -4112,6 +4443,7 @@ int UtcDaliAnimationAnimateByVector4TimePeriodP(void) Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( index ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -4136,7 +4468,7 @@ int UtcDaliAnimationAnimateByVector4TimePeriodP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( index ), startValue, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f)/* 75% animation progress, 50% animator progress */); @@ -4144,7 +4476,7 @@ int UtcDaliAnimationAnimateByVector4TimePeriodP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), startValue+(relativeValue*0.5f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( index ), startValue+(relativeValue*0.5f), TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/); @@ -4152,13 +4484,13 @@ int UtcDaliAnimationAnimateByVector4TimePeriodP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( index ), targetValue, TEST_LOCATION ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( index ), targetValue, TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( index ), targetValue, TEST_LOCATION ); END_TEST; } @@ -4173,6 +4505,7 @@ int UtcDaliAnimationAnimateByVector4AlphaFunctionTimePeriodP(void) Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( index ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -4198,7 +4531,7 @@ int UtcDaliAnimationAnimateByVector4AlphaFunctionTimePeriodP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( index ), startValue, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f)/* 75% animation progress, 50% animator progress */); @@ -4206,7 +4539,7 @@ int UtcDaliAnimationAnimateByVector4AlphaFunctionTimePeriodP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), startValue+(relativeValue*0.5f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( index ), startValue+(relativeValue*0.5f), TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/); @@ -4214,13 +4547,13 @@ int UtcDaliAnimationAnimateByVector4AlphaFunctionTimePeriodP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( index ), targetValue, TEST_LOCATION ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( index ), targetValue, TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( index ), targetValue, TEST_LOCATION ); END_TEST; } @@ -4234,7 +4567,7 @@ int UtcDaliAnimationAnimateByActorPositionP(void) Stage::GetCurrent().Add(actor); application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), startPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), startPosition, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -4248,6 +4581,9 @@ int UtcDaliAnimationAnimateByActorPositionP(void) // Start the animation animation.Play(); + // Target value should be retrievable straight away + DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); + bool signalReceived(false); AnimationFinishCheck finishCheck(signalReceived); animation.FinishedSignal().Connect(&application, finishCheck); @@ -4258,7 +4594,7 @@ int UtcDaliAnimationAnimateByActorPositionP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), ninetyFivePercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), ninetyFivePercentProgress, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*50.0f) + 1u/*just beyond the animation duration*/); @@ -4266,33 +4602,72 @@ int UtcDaliAnimationAnimateByActorPositionP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); END_TEST; } -int UtcDaliAnimationAnimateByActorPositionAlphaFunctionP(void) +int UtcDaliAnimationAnimateByActorPositionComponentsP(void) { TestApplication application; Actor actor = Actor::New(); - Vector3 startPosition(10.0f, 10.0f, 10.0f); - actor.SetPosition(startPosition); Stage::GetCurrent().Add(actor); - application.SendNotification(); - application.Render(0); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), startPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); Animation animation = Animation::New(durationSeconds); - Vector3 targetPosition(20.0f, 20.0f, 20.0f); - Vector3 relativePosition(targetPosition - startPosition); + Vector3 targetPosition(200.0f, 300.0f, 400.0f); + Vector3 relativePosition(targetPosition - Vector3::ZERO); + animation.AnimateBy( Property( actor, Actor::Property::POSITION_X ), relativePosition.x ); + animation.AnimateBy( Property( actor, Actor::Property::POSITION_Y ), relativePosition.y ); + animation.AnimateBy( Property( actor, Actor::Property::POSITION_Z ), relativePosition.z ); + + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION ); + + // Start the animation + animation.Play(); + + // Target value should be retrievable straight away + DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_X ), targetPosition.x, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_Y ), targetPosition.y, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_Z ), targetPosition.z, TEST_LOCATION ); + + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION ); // Not changed yet + + application.SendNotification(); + application.Render( 1000 ); // 1 second progress + + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); + + END_TEST; +} + +int UtcDaliAnimationAnimateByActorPositionAlphaFunctionP(void) +{ + TestApplication application; + + Actor actor = Actor::New(); + Vector3 startPosition(10.0f, 10.0f, 10.0f); + actor.SetPosition(startPosition); + Stage::GetCurrent().Add(actor); + application.SendNotification(); + application.Render(0); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), startPosition, TEST_LOCATION ); + + // Build the animation + float durationSeconds(1.0f); + Animation animation = Animation::New(durationSeconds); + Vector3 targetPosition(20.0f, 20.0f, 20.0f); + Vector3 relativePosition(targetPosition - startPosition); animation.AnimateBy(Property(actor, Actor::Property::POSITION), relativePosition, AlphaFunction::EASE_OUT); Vector3 ninetyFivePercentProgress(startPosition + relativePosition*0.95f); @@ -4312,7 +4687,7 @@ int UtcDaliAnimationAnimateByActorPositionAlphaFunctionP(void) finishCheck.CheckSignalNotReceived(); // The position should have moved more, than with a linear alpha function - Vector3 current(actor.GetCurrentPosition()); + Vector3 current(actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION )); DALI_TEST_CHECK( current.x > ninetyFivePercentProgress.x ); DALI_TEST_CHECK( current.y > ninetyFivePercentProgress.y ); DALI_TEST_CHECK( current.z > ninetyFivePercentProgress.z ); @@ -4323,13 +4698,13 @@ int UtcDaliAnimationAnimateByActorPositionAlphaFunctionP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); END_TEST; } @@ -4343,7 +4718,7 @@ int UtcDaliAnimationAnimateByActorPositionTimePeriodP(void) Stage::GetCurrent().Add(actor); application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), startPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), startPosition, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -4370,7 +4745,7 @@ int UtcDaliAnimationAnimateByActorPositionTimePeriodP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), startPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), startPosition, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/); @@ -4378,13 +4753,13 @@ int UtcDaliAnimationAnimateByActorPositionTimePeriodP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); END_TEST; } @@ -4398,7 +4773,7 @@ int UtcDaliAnimationAnimateByActorPositionAlphaFunctionTimePeriodP(void) Stage::GetCurrent().Add(actor); application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), startPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), startPosition, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -4426,7 +4801,7 @@ int UtcDaliAnimationAnimateByActorPositionAlphaFunctionTimePeriodP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), startPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), startPosition, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/); @@ -4434,13 +4809,13 @@ int UtcDaliAnimationAnimateByActorPositionAlphaFunctionTimePeriodP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); application.Render(0); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); END_TEST; } @@ -4449,9 +4824,9 @@ int UtcDaliAnimationAnimateByActorOrientationP1(void) TestApplication application; Actor actor = Actor::New(); - actor.SetOrientation( Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) ); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) ); Stage::GetCurrent().Add(actor); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion( Dali::ANGLE_0, Vector3::YAXIS ), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::YAXIS ), ROTATION_EPSILON, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -4463,6 +4838,9 @@ int UtcDaliAnimationAnimateByActorOrientationP1(void) // Start the animation animation.Play(); + // Target value should be retrievable straight away + DALI_TEST_EQUALS( actor.GetProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(relativeRotationRadians, Vector3::YAXIS), TEST_LOCATION ); + bool signalReceived(false); AnimationFinishCheck finishCheck(signalReceived); animation.FinishedSignal().Connect(&application, finishCheck); @@ -4473,7 +4851,7 @@ int UtcDaliAnimationAnimateByActorOrientationP1(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * 0.25f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(relativeRotationRadians * 0.25f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f)/* 50% progress */); @@ -4481,7 +4859,7 @@ int UtcDaliAnimationAnimateByActorOrientationP1(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * 0.5f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(relativeRotationRadians * 0.5f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f)/* 75% progress */); @@ -4489,7 +4867,7 @@ int UtcDaliAnimationAnimateByActorOrientationP1(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * 0.75f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(relativeRotationRadians * 0.75f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/); @@ -4497,7 +4875,7 @@ int UtcDaliAnimationAnimateByActorOrientationP1(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(relativeRotationRadians, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); END_TEST; } @@ -4508,9 +4886,9 @@ int UtcDaliAnimationAnimateByActorOrientationP2(void) tet_printf("Testing that rotation angle > 360 performs full rotations\n"); Actor actor = Actor::New(); - actor.SetOrientation( Quaternion( Dali::ANGLE_0, Vector3::ZAXIS ) ); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Dali::ANGLE_0, Vector3::ZAXIS ) ); Stage::GetCurrent().Add(actor); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion( Dali::ANGLE_0, Vector3::ZAXIS ), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::ZAXIS ), ROTATION_EPSILON, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -4533,7 +4911,7 @@ int UtcDaliAnimationAnimateByActorOrientationP2(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * 0.25f, Vector3::ZAXIS), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(relativeRotationRadians * 0.25f, Vector3::ZAXIS), ROTATION_EPSILON, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f)/* 50% progress */); @@ -4541,7 +4919,7 @@ int UtcDaliAnimationAnimateByActorOrientationP2(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * 0.5f, Vector3::ZAXIS), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(relativeRotationRadians * 0.5f, Vector3::ZAXIS), ROTATION_EPSILON, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f)/* 75% progress */); @@ -4549,7 +4927,7 @@ int UtcDaliAnimationAnimateByActorOrientationP2(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * 0.75f, Vector3::ZAXIS), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(relativeRotationRadians * 0.75f, Vector3::ZAXIS), ROTATION_EPSILON, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/); @@ -4557,7 +4935,7 @@ int UtcDaliAnimationAnimateByActorOrientationP2(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians, Vector3::ZAXIS), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(relativeRotationRadians, Vector3::ZAXIS), ROTATION_EPSILON, TEST_LOCATION ); END_TEST; } @@ -4569,9 +4947,9 @@ int UtcDaliAnimationAnimateByActorOrientationP3(void) tet_printf("Testing that rotation angle > 360 performs partial rotations when cast to Quaternion\n"); Actor actor = Actor::New(); - actor.SetOrientation( Quaternion( Dali::ANGLE_0, Vector3::ZAXIS ) ); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Dali::ANGLE_0, Vector3::ZAXIS ) ); Stage::GetCurrent().Add(actor); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion( Dali::ANGLE_0, Vector3::ZAXIS ), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::ZAXIS ), ROTATION_EPSILON, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -4596,7 +4974,7 @@ int UtcDaliAnimationAnimateByActorOrientationP3(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(actualRotationRadians * 0.25f, Vector3::ZAXIS), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(actualRotationRadians * 0.25f, Vector3::ZAXIS), ROTATION_EPSILON, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f)/* 50% progress */); @@ -4604,7 +4982,7 @@ int UtcDaliAnimationAnimateByActorOrientationP3(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(actualRotationRadians * 0.5f, Vector3::ZAXIS), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(actualRotationRadians * 0.5f, Vector3::ZAXIS), ROTATION_EPSILON, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f)/* 75% progress */); @@ -4612,7 +4990,7 @@ int UtcDaliAnimationAnimateByActorOrientationP3(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(actualRotationRadians * 0.75f, Vector3::ZAXIS), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(actualRotationRadians * 0.75f, Vector3::ZAXIS), ROTATION_EPSILON, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/); @@ -4620,8 +4998,8 @@ int UtcDaliAnimationAnimateByActorOrientationP3(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(actualRotationRadians, Vector3::ZAXIS), ROTATION_EPSILON, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians, Vector3::ZAXIS), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(actualRotationRadians, Vector3::ZAXIS), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(relativeRotationRadians, Vector3::ZAXIS), ROTATION_EPSILON, TEST_LOCATION ); END_TEST; } @@ -4631,9 +5009,9 @@ int UtcDaliAnimationAnimateByActorOrientationAlphaFunctionP(void) TestApplication application; Actor actor = Actor::New(); - actor.SetOrientation( Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) ); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) ); Stage::GetCurrent().Add(actor); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion( Dali::ANGLE_0, Vector3::YAXIS ), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::YAXIS ), ROTATION_EPSILON, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -4655,7 +5033,7 @@ int UtcDaliAnimationAnimateByActorOrientationAlphaFunctionP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * 0.25f*0.25f*0.25f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(relativeRotationRadians * 0.25f*0.25f*0.25f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f)/* 50% progress */); @@ -4663,7 +5041,7 @@ int UtcDaliAnimationAnimateByActorOrientationAlphaFunctionP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * 0.5f*0.5f*0.5f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(relativeRotationRadians * 0.5f*0.5f*0.5f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f)/* 75% progress */); @@ -4671,7 +5049,7 @@ int UtcDaliAnimationAnimateByActorOrientationAlphaFunctionP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * 0.75f*0.75f*0.75f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(relativeRotationRadians * 0.75f*0.75f*0.75f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/); @@ -4679,7 +5057,7 @@ int UtcDaliAnimationAnimateByActorOrientationAlphaFunctionP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(relativeRotationRadians, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); END_TEST; } @@ -4688,9 +5066,9 @@ int UtcDaliAnimationAnimateByActorOrientationAlphaFunctionTimePeriodP(void) TestApplication application; Actor actor = Actor::New(); - actor.SetOrientation( Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) ); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) ); Stage::GetCurrent().Add(actor); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion( Dali::ANGLE_0, Vector3::YAXIS ), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::YAXIS ), ROTATION_EPSILON, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -4715,7 +5093,7 @@ int UtcDaliAnimationAnimateByActorOrientationAlphaFunctionTimePeriodP(void) application.SendNotification(); finishCheck.CheckSignalNotReceived(); float progress = max(0.0f, 0.25f - delay) / (1.0f - delay); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * progress*progress*progress, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(relativeRotationRadians * progress*progress*progress, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f)/* 50% progress */); @@ -4724,7 +5102,7 @@ int UtcDaliAnimationAnimateByActorOrientationAlphaFunctionTimePeriodP(void) application.SendNotification(); finishCheck.CheckSignalNotReceived(); progress = max(0.0f, 0.5f - delay) / (1.0f - delay); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * progress*progress*progress, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(relativeRotationRadians * progress*progress*progress, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f)/* 75% progress */); @@ -4733,7 +5111,7 @@ int UtcDaliAnimationAnimateByActorOrientationAlphaFunctionTimePeriodP(void) application.SendNotification(); finishCheck.CheckSignalNotReceived(); progress = max(0.0f, 0.75f - delay) / (1.0f - delay); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * progress*progress*progress, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(relativeRotationRadians * progress*progress*progress, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/); @@ -4741,7 +5119,7 @@ int UtcDaliAnimationAnimateByActorOrientationAlphaFunctionTimePeriodP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(relativeRotationRadians, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); END_TEST; } @@ -4751,7 +5129,7 @@ int UtcDaliAnimationAnimateByActorScaleP(void) Actor actor = Actor::New(); Stage::GetCurrent().Add(actor); - DALI_TEST_EQUALS( actor.GetCurrentScale(), Vector3::ONE, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ), Vector3::ONE, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -4765,6 +5143,9 @@ int UtcDaliAnimationAnimateByActorScaleP(void) // Start the animation animation.Play(); + // Target value should be retrievable straight away + DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SCALE ), targetScale, TEST_LOCATION ); + bool signalReceived(false); AnimationFinishCheck finishCheck(signalReceived); animation.FinishedSignal().Connect(&application, finishCheck); @@ -4775,7 +5156,7 @@ int UtcDaliAnimationAnimateByActorScaleP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentScale(), ninetyNinePercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ), ninetyNinePercentProgress, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*10.0f) + 1u/*just beyond the animation duration*/); @@ -4783,14 +5164,14 @@ int UtcDaliAnimationAnimateByActorScaleP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentScale(), targetScale, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ), targetScale, TEST_LOCATION ); // Reset everything finishCheck.Reset(); actor.SetScale(Vector3::ONE); application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( actor.GetCurrentScale(), Vector3::ONE, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ), Vector3::ONE, TEST_LOCATION ); // Repeat with a different (ease-in) alpha function animation = Animation::New(durationSeconds); @@ -4806,7 +5187,7 @@ int UtcDaliAnimationAnimateByActorScaleP(void) finishCheck.CheckSignalNotReceived(); // The scale should have grown less, than with a linear alpha function - Vector3 current(actor.GetCurrentScale()); + Vector3 current(actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE )); DALI_TEST_CHECK( current.x > 1.0f ); DALI_TEST_CHECK( current.y > 1.0f ); DALI_TEST_CHECK( current.z > 1.0f ); @@ -4820,14 +5201,14 @@ int UtcDaliAnimationAnimateByActorScaleP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentScale(), targetScale, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ), targetScale, TEST_LOCATION ); // Reset everything finishCheck.Reset(); actor.SetScale(Vector3::ONE); application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( actor.GetCurrentScale(), Vector3::ONE, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ), Vector3::ONE, TEST_LOCATION ); // Repeat with a delay float delay = 0.5f; @@ -4842,7 +5223,7 @@ int UtcDaliAnimationAnimateByActorScaleP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentScale(), Vector3::ONE, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ), Vector3::ONE, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/); @@ -4850,7 +5231,240 @@ int UtcDaliAnimationAnimateByActorScaleP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentScale(), targetScale, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ), targetScale, TEST_LOCATION ); + END_TEST; +} + +int UtcDaliAnimationAnimateByActorScaleComponentsP(void) +{ + TestApplication application; + + Actor actor = Actor::New(); + Stage::GetCurrent().Add(actor); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ), Vector3::ONE, TEST_LOCATION ); + + // Build the animation + float durationSeconds(1.0f); + Animation animation = Animation::New(durationSeconds); + Vector3 targetScale(2.0f, 3.0f, 4.0f); + Vector3 relativeScale(targetScale - Vector3::ONE); + animation.AnimateBy( Property( actor, Actor::Property::SCALE_X ), relativeScale.x ); + animation.AnimateBy( Property( actor, Actor::Property::SCALE_Y ), relativeScale.y ); + animation.AnimateBy( Property( actor, Actor::Property::SCALE_Z ), relativeScale.z ); + + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ), Vector3::ONE, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SCALE ), Vector3::ONE, TEST_LOCATION ); + + // Start the animation + animation.Play(); + + // Target value should be retrievable straight away + DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SCALE ), targetScale, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SCALE_X ), targetScale.x, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SCALE_Y ), targetScale.y, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SCALE_Z ), targetScale.z, TEST_LOCATION ); + + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ), Vector3::ONE, TEST_LOCATION ); // Not changed yet + + application.SendNotification(); + application.Render( 1000 ); // 1 second progress + + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ), targetScale, TEST_LOCATION ); + + END_TEST; +} + +int UtcDaliAnimationAnimateByActorColorP(void) +{ + TestApplication application; + + Actor actor = Actor::New(); + Stage::GetCurrent().Add(actor); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), Color::WHITE, TEST_LOCATION ); + + // Build the animation + float durationSeconds(1.0f); + Animation animation = Animation::New(durationSeconds); + Vector4 targetColor( 0.5f, 0.75f, 0.8f, 0.1f ); + Vector4 relativeColor( targetColor - Color::WHITE ); + animation.AnimateBy( Property( actor, Actor::Property::COLOR ), relativeColor ); + + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), Color::WHITE, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< Vector4 >( Actor::Property::COLOR ), Color::WHITE, TEST_LOCATION ); + + // Start the animation + animation.Play(); + + // Target value should be retrievable straight away + DALI_TEST_EQUALS( actor.GetProperty< Vector4 >( Actor::Property::COLOR ), targetColor, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::COLOR_RED ), targetColor.r, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::COLOR_GREEN ), targetColor.g, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::COLOR_BLUE ), targetColor.b, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::COLOR_ALPHA ), targetColor.a, TEST_LOCATION ); + + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), Color::WHITE, TEST_LOCATION ); // Not changed yet + + application.SendNotification(); + application.Render( 1000 ); // 1 second progress + + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), targetColor, TEST_LOCATION ); + + END_TEST; +} + +int UtcDaliAnimationAnimateByActorColorComponentsP(void) +{ + TestApplication application; + + Actor actor = Actor::New(); + Stage::GetCurrent().Add(actor); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), Color::WHITE, TEST_LOCATION ); + + // Build the animation + float durationSeconds(1.0f); + Animation animation = Animation::New(durationSeconds); + Vector4 targetColor( 0.5f, 0.75f, 0.8f, 0.1f ); + Vector4 relativeColor( targetColor - Color::WHITE ); + animation.AnimateBy( Property( actor, Actor::Property::COLOR_RED ), relativeColor.r ); + animation.AnimateBy( Property( actor, Actor::Property::COLOR_GREEN ), relativeColor.g ); + animation.AnimateBy( Property( actor, Actor::Property::COLOR_BLUE ), relativeColor.b ); + animation.AnimateBy( Property( actor, Actor::Property::COLOR_ALPHA ), relativeColor.a ); + + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), Color::WHITE, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< Vector4 >( Actor::Property::COLOR ), Color::WHITE, TEST_LOCATION ); + + // Start the animation + animation.Play(); + + // Target value should be retrievable straight away + DALI_TEST_EQUALS( actor.GetProperty< Vector4 >( Actor::Property::COLOR ), targetColor, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::COLOR_RED ), targetColor.r, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::COLOR_GREEN ), targetColor.g, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::COLOR_BLUE ), targetColor.b, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::COLOR_ALPHA ), targetColor.a, TEST_LOCATION ); + + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), Color::WHITE, TEST_LOCATION ); // Not changed yet + + application.SendNotification(); + application.Render( 1000 ); // 1 second progress + + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), targetColor, TEST_LOCATION ); + + END_TEST; +} + +int UtcDaliAnimationAnimateByActorSizeP(void) +{ + TestApplication application; + + Actor actor = Actor::New(); + Stage::GetCurrent().Add(actor); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ), Vector3::ZERO, TEST_LOCATION ); + + // Build the animation + float durationSeconds(1.0f); + Animation animation = Animation::New(durationSeconds); + Vector3 targetSize( 100.0f, 200.0f, 300.0f ); + Vector3 relativeSize( targetSize - Vector3::ZERO ); + animation.AnimateBy( Property( actor, Actor::Property::SIZE ), relativeSize ); + + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ), Vector3::ZERO, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SIZE ), Vector3::ZERO, TEST_LOCATION ); + + // Start the animation + animation.Play(); + + // Target value should be retrievable straight away + DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SIZE ), targetSize, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SIZE_WIDTH ), targetSize.width, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SIZE_HEIGHT ), targetSize.height, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SIZE_DEPTH ), targetSize.depth, TEST_LOCATION ); + + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ), Vector3::ZERO, TEST_LOCATION ); // Not changed yet + + application.SendNotification(); + application.Render( 1000 ); // 1 second progress + + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ), targetSize, TEST_LOCATION ); + + END_TEST; +} + +int UtcDaliAnimationAnimateByActorSizeComponentsP(void) +{ + TestApplication application; + + Actor actor = Actor::New(); + Stage::GetCurrent().Add(actor); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ), Vector3::ZERO, TEST_LOCATION ); + + // Build the animation + float durationSeconds(1.0f); + Animation animation = Animation::New(durationSeconds); + Vector3 targetSize( 100.0f, 200.0f, 300.0f ); + Vector3 relativeSize( targetSize - Vector3::ZERO ); + animation.AnimateBy( Property( actor, Actor::Property::SIZE_WIDTH ), relativeSize.width ); + animation.AnimateBy( Property( actor, Actor::Property::SIZE_HEIGHT ), relativeSize.height ); + animation.AnimateBy( Property( actor, Actor::Property::SIZE_DEPTH ), relativeSize.depth ); + + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ), Vector3::ZERO, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SIZE ), Vector3::ZERO, TEST_LOCATION ); + + // Start the animation + animation.Play(); + + // Target value should be retrievable straight away + DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SIZE ), targetSize, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SIZE_WIDTH ), targetSize.width, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SIZE_HEIGHT ), targetSize.height, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SIZE_DEPTH ), targetSize.depth, TEST_LOCATION ); + + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ), Vector3::ZERO, TEST_LOCATION ); // Not changed yet + + application.SendNotification(); + application.Render( 1000 ); // 1 second progress + + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ), targetSize, TEST_LOCATION ); + + END_TEST; +} + +int UtcDaliAnimationAnimateByActorVisibilityP(void) +{ + TestApplication application; + + Actor actor = Actor::New(); + Stage::GetCurrent().Add(actor); + DALI_TEST_EQUALS( actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ), true, TEST_LOCATION ); + + actor.SetProperty( Actor::Property::VISIBLE, false ); + + application.SendNotification(); + application.Render(); + + DALI_TEST_EQUALS( actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ), false, TEST_LOCATION ); + + // Build the animation + float durationSeconds(1.0f); + Animation animation = Animation::New(durationSeconds); + bool targetVisibility( true ); + bool relativeVisibility( targetVisibility ); + animation.AnimateBy( Property( actor, Actor::Property::VISIBLE ), relativeVisibility ); + + DALI_TEST_EQUALS( actor.GetProperty< bool >( Actor::Property::VISIBLE ), false, TEST_LOCATION ); + + // Start the animation + animation.Play(); + + // Target value should be retrievable straight away + DALI_TEST_EQUALS( actor.GetProperty< bool >( Actor::Property::VISIBLE ), targetVisibility, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ), false, TEST_LOCATION ); // Not changed yet + + application.SendNotification(); + application.Render( 1000 ); // 1 second progress + + DALI_TEST_EQUALS( actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ), true, TEST_LOCATION ); + END_TEST; } @@ -4865,6 +5479,7 @@ int UtcDaliAnimationAnimateToBooleanP(void) Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); DALI_TEST_CHECK( actor.GetProperty(index) == startValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == startValue ); // Build the animation float durationSeconds(2.0f); @@ -4885,7 +5500,7 @@ int UtcDaliAnimationAnimateToBooleanP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_CHECK( actor.GetProperty(index) == startValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == startValue ); application.SendNotification(); application.Render(static_cast(durationSeconds*50.0f) + 1u/*just beyond the animation duration*/); @@ -4893,13 +5508,13 @@ int UtcDaliAnimationAnimateToBooleanP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_CHECK( actor.GetProperty(index) == targetValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == targetValue ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_CHECK( actor.GetProperty(index) == targetValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == targetValue ); application.Render(0); - DALI_TEST_CHECK( actor.GetProperty(index) == targetValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == targetValue ); // Repeat with target value "false" animation = Animation::New(durationSeconds); @@ -4918,7 +5533,7 @@ int UtcDaliAnimationAnimateToBooleanP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_CHECK( actor.GetProperty(index) == targetValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == targetValue ); application.SendNotification(); application.Render(static_cast(durationSeconds*50.0f) + 1u/*just beyond the animation duration*/); @@ -4926,13 +5541,13 @@ int UtcDaliAnimationAnimateToBooleanP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_CHECK( actor.GetProperty(index) == finalValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == finalValue ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_CHECK( actor.GetProperty(index) == finalValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == finalValue ); application.Render(0); - DALI_TEST_CHECK( actor.GetProperty(index) == finalValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == finalValue ); END_TEST; } @@ -4947,6 +5562,7 @@ int UtcDaliAnimationAnimateToBooleanAlphaFunctionP(void) Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); DALI_TEST_CHECK( actor.GetProperty(index) == startValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == startValue ); // Build the animation float durationSeconds(2.0f); @@ -4967,7 +5583,7 @@ int UtcDaliAnimationAnimateToBooleanAlphaFunctionP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_CHECK( actor.GetProperty(index) == startValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == startValue ); application.SendNotification(); application.Render(static_cast(durationSeconds*50.0f) + 1u/*just beyond the animation duration*/); @@ -4975,13 +5591,13 @@ int UtcDaliAnimationAnimateToBooleanAlphaFunctionP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_CHECK( actor.GetProperty(index) == targetValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == targetValue ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_CHECK( actor.GetProperty(index) == targetValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == targetValue ); application.Render(0); - DALI_TEST_CHECK( actor.GetProperty(index) == targetValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == targetValue ); // Repeat with target value "false" animation = Animation::New(durationSeconds); @@ -5000,7 +5616,7 @@ int UtcDaliAnimationAnimateToBooleanAlphaFunctionP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_CHECK( actor.GetProperty(index) == targetValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == targetValue ); application.SendNotification(); application.Render(static_cast(durationSeconds*50.0f) + 1u/*just beyond the animation duration*/); @@ -5008,13 +5624,13 @@ int UtcDaliAnimationAnimateToBooleanAlphaFunctionP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_CHECK( actor.GetProperty(index) == finalValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == finalValue ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_CHECK( actor.GetProperty(index) == finalValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == finalValue ); application.Render(0); - DALI_TEST_CHECK( actor.GetProperty(index) == finalValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == finalValue ); END_TEST; } @@ -5029,6 +5645,7 @@ int UtcDaliAnimationAnimateToBooleanTimePeriodP(void) Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); DALI_TEST_CHECK( actor.GetProperty(index) == startValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == startValue ); // Build the animation float durationSeconds(2.0f); @@ -5052,7 +5669,7 @@ int UtcDaliAnimationAnimateToBooleanTimePeriodP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_CHECK( actor.GetProperty(index) == startValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == startValue ); application.SendNotification(); application.Render(static_cast(animatorDurationSeconds*50.0f) + 1u/*just beyond the animator duration*/); @@ -5062,7 +5679,7 @@ int UtcDaliAnimationAnimateToBooleanTimePeriodP(void) finishCheck.CheckSignalNotReceived(); // ...however we should have reached the final value - DALI_TEST_CHECK( actor.GetProperty(index) == finalValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == finalValue ); application.SendNotification(); application.Render(static_cast(animatorDurationSeconds*1000.0f)/*just beyond the animation duration*/); @@ -5070,13 +5687,13 @@ int UtcDaliAnimationAnimateToBooleanTimePeriodP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_CHECK( actor.GetProperty(index) == finalValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == finalValue ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_CHECK( actor.GetProperty(index) == finalValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == finalValue ); application.Render(0); - DALI_TEST_CHECK( actor.GetProperty(index) == finalValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == finalValue ); END_TEST; } @@ -5091,6 +5708,7 @@ int UtcDaliAnimationAnimateToBooleanAlphaFunctionTimePeriodP(void) Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); DALI_TEST_CHECK( actor.GetProperty(index) == startValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == startValue ); // Build the animation float durationSeconds(2.0f); @@ -5115,7 +5733,7 @@ int UtcDaliAnimationAnimateToBooleanAlphaFunctionTimePeriodP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_CHECK( actor.GetProperty(index) == startValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == startValue ); application.SendNotification(); application.Render(static_cast(animatorDurationSeconds*50.0f) + 1u/*just beyond the animator duration*/); @@ -5125,7 +5743,7 @@ int UtcDaliAnimationAnimateToBooleanAlphaFunctionTimePeriodP(void) finishCheck.CheckSignalNotReceived(); // ...however we should have reached the final value - DALI_TEST_CHECK( actor.GetProperty(index) == finalValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == finalValue ); application.SendNotification(); application.Render(static_cast(animatorDurationSeconds*1000.0f)/*just beyond the animation duration*/); @@ -5133,13 +5751,13 @@ int UtcDaliAnimationAnimateToBooleanAlphaFunctionTimePeriodP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_CHECK( actor.GetProperty(index) == finalValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == finalValue ); // Check that nothing has changed after a couple of buffer swaps application.Render(0); - DALI_TEST_CHECK( actor.GetProperty(index) == finalValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == finalValue ); application.Render(0); - DALI_TEST_CHECK( actor.GetProperty(index) == finalValue ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == finalValue ); END_TEST; } @@ -5154,6 +5772,7 @@ int UtcDaliAnimationAnimateToFloatP(void) Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( index ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(2.0f); @@ -5177,7 +5796,7 @@ int UtcDaliAnimationAnimateToFloatP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), ninetyFivePercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( index ), ninetyFivePercentProgress, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*50.0f) + 1u/*just beyond the animation duration*/); @@ -5185,7 +5804,7 @@ int UtcDaliAnimationAnimateToFloatP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( index ), targetValue, TEST_LOCATION ); END_TEST; } @@ -5200,6 +5819,7 @@ int UtcDaliAnimationAnimateToFloatAlphaFunctionP(void) Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( index ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -5225,7 +5845,7 @@ int UtcDaliAnimationAnimateToFloatAlphaFunctionP(void) finishCheck.CheckSignalNotReceived(); // The position should have moved more, than with a linear alpha function - float current(actor.GetProperty(index)); + float current( actor.GetCurrentProperty< float >( index ) ); DALI_TEST_CHECK( current > ninetyFivePercentProgress ); application.SendNotification(); @@ -5234,7 +5854,7 @@ int UtcDaliAnimationAnimateToFloatAlphaFunctionP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( index ), targetValue, TEST_LOCATION ); END_TEST; } @@ -5249,6 +5869,7 @@ int UtcDaliAnimationAnimateToFloatTimePeriodP(void) Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( index ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -5273,7 +5894,7 @@ int UtcDaliAnimationAnimateToFloatTimePeriodP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( index ), startValue, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f)/* 75% animation progress, 50% animator progress */); @@ -5281,7 +5902,7 @@ int UtcDaliAnimationAnimateToFloatTimePeriodP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), startValue+(relativeValue*0.5f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( index ), startValue+(relativeValue*0.5f), TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/); @@ -5289,7 +5910,7 @@ int UtcDaliAnimationAnimateToFloatTimePeriodP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( index ), targetValue, TEST_LOCATION ); END_TEST; } @@ -5304,6 +5925,7 @@ int UtcDaliAnimationAnimateToFloatAlphaFunctionTimePeriodP(void) Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( index ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -5329,7 +5951,7 @@ int UtcDaliAnimationAnimateToFloatAlphaFunctionTimePeriodP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( index ), startValue, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f)/* 75% animation progress, 50% animator progress */); @@ -5337,7 +5959,7 @@ int UtcDaliAnimationAnimateToFloatAlphaFunctionTimePeriodP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), startValue+(relativeValue*0.5f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( index ), startValue+(relativeValue*0.5f), TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/); @@ -5345,7 +5967,7 @@ int UtcDaliAnimationAnimateToFloatAlphaFunctionTimePeriodP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( index ), targetValue, TEST_LOCATION ); END_TEST; } @@ -5360,6 +5982,7 @@ int UtcDaliAnimationAnimateToIntegerP(void) Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< int >( index ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(2.0f); @@ -5383,7 +6006,7 @@ int UtcDaliAnimationAnimateToIntegerP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), ninetyFivePercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< int >( index ), ninetyFivePercentProgress, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*50.0f) + 1u/*just beyond the animation duration*/); @@ -5391,7 +6014,7 @@ int UtcDaliAnimationAnimateToIntegerP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< int >( index ), targetValue, TEST_LOCATION ); END_TEST; } @@ -5406,6 +6029,7 @@ int UtcDaliAnimationAnimateToIntegerAlphaFunctionP(void) Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< int >( index ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -5431,7 +6055,7 @@ int UtcDaliAnimationAnimateToIntegerAlphaFunctionP(void) finishCheck.CheckSignalNotReceived(); // The position should have moved more, than with a linear alpha function - int current(actor.GetProperty(index)); + int current( actor.GetCurrentProperty< int >( index ) ); DALI_TEST_CHECK( current > ninetyFivePercentProgress ); application.SendNotification(); @@ -5440,7 +6064,7 @@ int UtcDaliAnimationAnimateToIntegerAlphaFunctionP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< int >( index ), targetValue, TEST_LOCATION ); END_TEST; } @@ -5455,6 +6079,7 @@ int UtcDaliAnimationAnimateToIntegerTimePeriodP(void) Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< int >( index ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -5479,7 +6104,7 @@ int UtcDaliAnimationAnimateToIntegerTimePeriodP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< int >( index ), startValue, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f)/* 75% animation progress, 50% animator progress */); @@ -5487,7 +6112,7 @@ int UtcDaliAnimationAnimateToIntegerTimePeriodP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), static_cast(startValue+(relativeValue*0.5f)+0.5f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< int >( index ), static_cast(startValue+(relativeValue*0.5f)+0.5f), TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/); @@ -5495,7 +6120,7 @@ int UtcDaliAnimationAnimateToIntegerTimePeriodP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< int >( index ), targetValue, TEST_LOCATION ); END_TEST; } @@ -5510,6 +6135,7 @@ int UtcDaliAnimationAnimateToIntegerAlphaFunctionTimePeriodP(void) Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< int >( index ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -5535,7 +6161,7 @@ int UtcDaliAnimationAnimateToIntegerAlphaFunctionTimePeriodP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< int >( index ), startValue, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f)/* 75% animation progress, 50% animator progress */); @@ -5543,7 +6169,7 @@ int UtcDaliAnimationAnimateToIntegerAlphaFunctionTimePeriodP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), static_cast(startValue+(relativeValue*0.5f)+0.5f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< int >( index ), static_cast(startValue+(relativeValue*0.5f)+0.5f), TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/); @@ -5551,7 +6177,7 @@ int UtcDaliAnimationAnimateToIntegerAlphaFunctionTimePeriodP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< int >( index ), targetValue, TEST_LOCATION ); END_TEST; } @@ -5565,7 +6191,8 @@ int UtcDaliAnimationAnimateToVector2P(void) Vector2 startValue(-50.0f, -50.0f); Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); - DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< Vector2 >( index ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector2 >( index ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(2.0f); @@ -5589,7 +6216,7 @@ int UtcDaliAnimationAnimateToVector2P(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), ninetyFivePercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector2 >( index ), ninetyFivePercentProgress, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*50.0f) + 1u/*just beyond the animation duration*/); @@ -5597,7 +6224,7 @@ int UtcDaliAnimationAnimateToVector2P(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector2 >( index ), targetValue, TEST_LOCATION ); END_TEST; } @@ -5611,7 +6238,8 @@ int UtcDaliAnimationAnimateToVector2AlphaFunctionP(void) Vector2 startValue(1000.0f, 1000.0f); Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); - DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< Vector2 >( index ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector2 >( index ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -5637,7 +6265,7 @@ int UtcDaliAnimationAnimateToVector2AlphaFunctionP(void) finishCheck.CheckSignalNotReceived(); // The position should have moved more, than with a linear alpha function - Vector2 current(actor.GetProperty(index)); + Vector2 current( actor.GetCurrentProperty< Vector2 >( index ) ); DALI_TEST_CHECK( current.x > ninetyFivePercentProgress.x ); DALI_TEST_CHECK( current.y > ninetyFivePercentProgress.y ); @@ -5647,7 +6275,7 @@ int UtcDaliAnimationAnimateToVector2AlphaFunctionP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector2 >( index ), targetValue, TEST_LOCATION ); END_TEST; } @@ -5661,7 +6289,8 @@ int UtcDaliAnimationAnimateToVector2TimePeriodP(void) Vector2 startValue(10.0f, 10.0f); Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); - DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< Vector2 >( index ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector2 >( index ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -5686,7 +6315,7 @@ int UtcDaliAnimationAnimateToVector2TimePeriodP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector2 >( index ), startValue, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f)/* 75% animation progress, 50% animator progress */); @@ -5694,7 +6323,7 @@ int UtcDaliAnimationAnimateToVector2TimePeriodP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), startValue+(relativeValue*0.5f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector2 >( index ), startValue+(relativeValue*0.5f), TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/); @@ -5702,7 +6331,7 @@ int UtcDaliAnimationAnimateToVector2TimePeriodP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector2 >( index ), targetValue, TEST_LOCATION ); END_TEST; } @@ -5716,7 +6345,8 @@ int UtcDaliAnimationAnimateToVector2AlphaFunctionTimePeriodP(void) Vector2 startValue(10.0f, 10.0f); Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); - DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< Vector2 >( index ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector2 >( index ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -5739,10 +6369,11 @@ int UtcDaliAnimationAnimateToVector2AlphaFunctionTimePeriodP(void) application.SendNotification(); application.Render(static_cast(durationSeconds*500.0f)/* 50% animation progress, 0% animator progress */); - // We didn't expect the animation to finish yet + // We didn't expect the animation to finish yet, but cached value should be the final one application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< Vector2 >( index ), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty( index ), startValue, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f)/* 75% animation progress, 50% animator progress */); @@ -5750,7 +6381,7 @@ int UtcDaliAnimationAnimateToVector2AlphaFunctionTimePeriodP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), startValue+(relativeValue*0.5f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector2 >( index ), startValue+(relativeValue*0.5f), TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/); @@ -5758,7 +6389,8 @@ int UtcDaliAnimationAnimateToVector2AlphaFunctionTimePeriodP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector2 >( index ), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< Vector2 >( index ), targetValue, TEST_LOCATION ); END_TEST; } @@ -5772,7 +6404,8 @@ int UtcDaliAnimationAnimateToVector3P(void) Vector3 startValue(-50.0f, -50.0f, -50.0f); Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); - DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty( index ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( index ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(2.0f); @@ -5796,7 +6429,7 @@ int UtcDaliAnimationAnimateToVector3P(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), ninetyFivePercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( index ), ninetyFivePercentProgress, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*50.0f) + 1u/*just beyond the animation duration*/); @@ -5804,7 +6437,7 @@ int UtcDaliAnimationAnimateToVector3P(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( index ), targetValue, TEST_LOCATION ); END_TEST; } @@ -5819,6 +6452,7 @@ int UtcDaliAnimationAnimateToVector3AlphaFunctionP(void) Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( index ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -5844,7 +6478,7 @@ int UtcDaliAnimationAnimateToVector3AlphaFunctionP(void) finishCheck.CheckSignalNotReceived(); // The position should have moved more, than with a linear alpha function - Vector3 current(actor.GetProperty(index)); + Vector3 current( actor.GetCurrentProperty< Vector3 >( index ) ); DALI_TEST_CHECK( current.x > ninetyFivePercentProgress.x ); DALI_TEST_CHECK( current.y > ninetyFivePercentProgress.y ); DALI_TEST_CHECK( current.z > ninetyFivePercentProgress.z ); @@ -5855,7 +6489,7 @@ int UtcDaliAnimationAnimateToVector3AlphaFunctionP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( index ), targetValue, TEST_LOCATION ); END_TEST; } @@ -5870,6 +6504,7 @@ int UtcDaliAnimationAnimateToVector3TimePeriodP(void) Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( index ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -5894,7 +6529,7 @@ int UtcDaliAnimationAnimateToVector3TimePeriodP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( index ), startValue, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f)/* 75% animation progress, 50% animator progress */); @@ -5902,7 +6537,7 @@ int UtcDaliAnimationAnimateToVector3TimePeriodP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), startValue+(relativeValue*0.5f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( index ), startValue+(relativeValue*0.5f), TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/); @@ -5910,7 +6545,7 @@ int UtcDaliAnimationAnimateToVector3TimePeriodP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( index ), targetValue, TEST_LOCATION ); END_TEST; } @@ -5925,6 +6560,7 @@ int UtcDaliAnimationAnimateToVector3AlphaFunctionTimePeriodP(void) Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( index ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -5950,7 +6586,7 @@ int UtcDaliAnimationAnimateToVector3AlphaFunctionTimePeriodP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( index ), startValue, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f)/* 75% animation progress, 50% animator progress */); @@ -5958,7 +6594,7 @@ int UtcDaliAnimationAnimateToVector3AlphaFunctionTimePeriodP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), startValue+(relativeValue*0.5f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( index ), startValue+(relativeValue*0.5f), TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/); @@ -5966,7 +6602,7 @@ int UtcDaliAnimationAnimateToVector3AlphaFunctionTimePeriodP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( index ), targetValue, TEST_LOCATION ); END_TEST; } @@ -5981,6 +6617,7 @@ int UtcDaliAnimationAnimateToVector3ComponentP(void) Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( index ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -6010,7 +6647,7 @@ int UtcDaliAnimationAnimateToVector3ComponentP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( index ), startValue, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f)/* 75% animation progress, 50% animator progress */); @@ -6018,7 +6655,7 @@ int UtcDaliAnimationAnimateToVector3ComponentP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), startValue+(relativeValue*0.5f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( index ), startValue+(relativeValue*0.5f), TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/); @@ -6026,7 +6663,7 @@ int UtcDaliAnimationAnimateToVector3ComponentP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( index ), targetValue, TEST_LOCATION ); END_TEST; } @@ -6041,6 +6678,7 @@ int UtcDaliAnimationAnimateToVector4P(void) Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( index ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(2.0f); @@ -6064,7 +6702,7 @@ int UtcDaliAnimationAnimateToVector4P(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), ninetyFivePercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( index ), ninetyFivePercentProgress, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*50.0f) + 1u/*just beyond the animation duration*/); @@ -6072,7 +6710,7 @@ int UtcDaliAnimationAnimateToVector4P(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( index ), targetValue, TEST_LOCATION ); END_TEST; } @@ -6087,6 +6725,7 @@ int UtcDaliAnimationAnimateToVector4AlphaFunctionP(void) Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( index ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -6112,7 +6751,7 @@ int UtcDaliAnimationAnimateToVector4AlphaFunctionP(void) finishCheck.CheckSignalNotReceived(); // The position should have moved more, than with a linear alpha function - Vector4 current(actor.GetProperty(index)); + Vector4 current( actor.GetCurrentProperty< Vector4 >( index ) ); DALI_TEST_CHECK( current.x > ninetyFivePercentProgress.x ); DALI_TEST_CHECK( current.y > ninetyFivePercentProgress.y ); DALI_TEST_CHECK( current.z > ninetyFivePercentProgress.z ); @@ -6124,7 +6763,7 @@ int UtcDaliAnimationAnimateToVector4AlphaFunctionP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( index ), targetValue, TEST_LOCATION ); END_TEST; } @@ -6138,7 +6777,8 @@ int UtcDaliAnimationAnimateToVector4TimePeriodP(void) Vector4 startValue(10.0f, 10.0f, 10.0f, 10.0f); Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); - DALI_TEST_EQUALS( actor.GetProperty(index), startValue, VECTOR4_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( index ), startValue, VECTOR4_EPSILON, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -6163,7 +6803,7 @@ int UtcDaliAnimationAnimateToVector4TimePeriodP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), startValue, VECTOR4_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( index ), startValue, VECTOR4_EPSILON, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f)/* 75% animation progress, 50% animator progress */); @@ -6171,7 +6811,7 @@ int UtcDaliAnimationAnimateToVector4TimePeriodP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), startValue+(relativeValue*0.5f), VECTOR4_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( index ), startValue+(relativeValue*0.5f), VECTOR4_EPSILON, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/); @@ -6179,7 +6819,7 @@ int UtcDaliAnimationAnimateToVector4TimePeriodP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, VECTOR4_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( index ), targetValue, VECTOR4_EPSILON, TEST_LOCATION ); END_TEST; } @@ -6194,6 +6834,7 @@ int UtcDaliAnimationAnimateToVector4AlphaFunctionTimePeriodP(void) Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( index ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -6219,7 +6860,7 @@ int UtcDaliAnimationAnimateToVector4AlphaFunctionTimePeriodP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( index ), startValue, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f)/* 75% animation progress, 50% animator progress */); @@ -6227,7 +6868,7 @@ int UtcDaliAnimationAnimateToVector4AlphaFunctionTimePeriodP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), startValue+(relativeValue*0.5f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( index ), startValue+(relativeValue*0.5f), TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/); @@ -6235,7 +6876,7 @@ int UtcDaliAnimationAnimateToVector4AlphaFunctionTimePeriodP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( index ), targetValue, TEST_LOCATION ); END_TEST; } @@ -6245,33 +6886,29 @@ int UtcDaliAnimationAnimateToActorParentOriginP(void) Actor actor = Actor::New(); Stage::GetCurrent().Add(actor); - DALI_TEST_EQUALS( actor.GetCurrentParentOrigin(), ParentOrigin::TOP_LEFT, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN ), ParentOrigin::TOP_LEFT, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); Animation animation = Animation::New(durationSeconds); Vector3 targetParentOrigin(ParentOrigin::BOTTOM_RIGHT); - try + DALI_TEST_ASSERTION( { animation.AnimateTo( Property(actor, Actor::Property::PARENT_ORIGIN), targetParentOrigin ); - } - catch (Dali::DaliException& e) - { - DALI_TEST_PRINT_ASSERT( e ); - DALI_TEST_ASSERT(e, "IsPropertyAnimatable( index )", TEST_LOCATION); - } + }, "Property is not animatable" ); + END_TEST; } -int UtcDaliAnimationAnimateToActorParentOriginXP(void) +int UtcDaliAnimationAnimateToActorParentOriginXN(void) { TestApplication application; Actor actor = Actor::New(); Stage::GetCurrent().Add(actor); float startValue(0.0f); - DALI_TEST_EQUALS( actor.GetCurrentParentOrigin().x, startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN ).x, startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::PARENT_ORIGIN_X), startValue, TEST_LOCATION ); // Build the animation @@ -6279,26 +6916,22 @@ int UtcDaliAnimationAnimateToActorParentOriginXP(void) Animation animation = Animation::New(durationSeconds); float targetX(1.0f); - try + DALI_TEST_ASSERTION( { animation.AnimateTo( Property(actor, Actor::Property::PARENT_ORIGIN_X), targetX ); - } - catch (Dali::DaliException& e) - { - DALI_TEST_PRINT_ASSERT( e ); - DALI_TEST_ASSERT(e, "IsPropertyAnimatable( index )", TEST_LOCATION); - } + }, "Property is not animatable" ); + END_TEST; } -int UtcDaliAnimationAnimateToActorParentOriginYP(void) +int UtcDaliAnimationAnimateToActorParentOriginYN(void) { TestApplication application; Actor actor = Actor::New(); Stage::GetCurrent().Add(actor); float startValue(0.0f); - DALI_TEST_EQUALS( actor.GetCurrentParentOrigin().y, startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN ).y, startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::PARENT_ORIGIN_Y), startValue, TEST_LOCATION ); // Build the animation @@ -6306,26 +6939,22 @@ int UtcDaliAnimationAnimateToActorParentOriginYP(void) Animation animation = Animation::New(durationSeconds); float targetY(1.0f); - try + DALI_TEST_ASSERTION( { animation.AnimateTo( Property(actor, Actor::Property::PARENT_ORIGIN_Y), targetY ); - } - catch (Dali::DaliException& e) - { - DALI_TEST_PRINT_ASSERT( e ); - DALI_TEST_ASSERT(e, "IsPropertyAnimatable( index )", TEST_LOCATION); - } + }, "Property is not animatable" ); + END_TEST; } -int UtcDaliAnimationAnimateToActorParentOriginZP(void) +int UtcDaliAnimationAnimateToActorParentOriginZN(void) { TestApplication application; Actor actor = Actor::New(); Stage::GetCurrent().Add(actor); float startValue(0.5f); - DALI_TEST_EQUALS( actor.GetCurrentParentOrigin().z, startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN ).z, startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::PARENT_ORIGIN_Z), startValue, TEST_LOCATION ); // Build the animation @@ -6333,51 +6962,43 @@ int UtcDaliAnimationAnimateToActorParentOriginZP(void) Animation animation = Animation::New(durationSeconds); float targetZ(1.0f); - try + DALI_TEST_ASSERTION( { animation.AnimateTo( Property(actor, Actor::Property::PARENT_ORIGIN_Z), targetZ ); - } - catch (Dali::DaliException& e) - { - DALI_TEST_PRINT_ASSERT( e ); - DALI_TEST_ASSERT(e, "IsPropertyAnimatable( index )", TEST_LOCATION); - } + }, "Property is not animatable" ); + END_TEST; } -int UtcDaliAnimationAnimateToActorAnchorPointP(void) +int UtcDaliAnimationAnimateToActorAnchorPointN(void) { TestApplication application; Actor actor = Actor::New(); Stage::GetCurrent().Add(actor); - DALI_TEST_EQUALS( actor.GetCurrentAnchorPoint(), AnchorPoint::CENTER, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT ), AnchorPoint::CENTER, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); Animation animation = Animation::New(durationSeconds); Vector3 targetAnchorPoint(AnchorPoint::TOP_LEFT); - try + DALI_TEST_ASSERTION( { animation.AnimateTo( Property(actor, Actor::Property::ANCHOR_POINT), targetAnchorPoint); - } - catch (Dali::DaliException& e) - { - DALI_TEST_PRINT_ASSERT( e ); - DALI_TEST_ASSERT(e, "IsPropertyAnimatable( index )", TEST_LOCATION); - } + }, "Property is not animatable" ); + END_TEST; } -int UtcDaliAnimationAnimateToActorAnchorPointXP(void) +int UtcDaliAnimationAnimateToActorAnchorPointXN(void) { TestApplication application; Actor actor = Actor::New(); Stage::GetCurrent().Add(actor); float startValue(0.5f); - DALI_TEST_EQUALS( actor.GetCurrentAnchorPoint().x, startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT ).x, startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ANCHOR_POINT_X), startValue, TEST_LOCATION ); // Build the animation @@ -6385,26 +7006,22 @@ int UtcDaliAnimationAnimateToActorAnchorPointXP(void) Animation animation = Animation::New(durationSeconds); float targetX(1.0f); - try + DALI_TEST_ASSERTION( { animation.AnimateTo( Property(actor, Actor::Property::ANCHOR_POINT_X), targetX ); - } - catch (Dali::DaliException& e) - { - DALI_TEST_PRINT_ASSERT( e ); - DALI_TEST_ASSERT(e, "IsPropertyAnimatable( index )", TEST_LOCATION); - } + }, "Property is not animatable" ); + END_TEST; } -int UtcDaliAnimationAnimateToActorAnchorPointYP(void) +int UtcDaliAnimationAnimateToActorAnchorPointYN(void) { TestApplication application; Actor actor = Actor::New(); Stage::GetCurrent().Add(actor); float startValue(0.5f); - DALI_TEST_EQUALS( actor.GetCurrentAnchorPoint().y, startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT ).y, startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ANCHOR_POINT_Y), startValue, TEST_LOCATION ); // Build the animation @@ -6412,26 +7029,22 @@ int UtcDaliAnimationAnimateToActorAnchorPointYP(void) Animation animation = Animation::New(durationSeconds); float targetY(0.0f); - try + DALI_TEST_ASSERTION( { animation.AnimateTo( Property(actor, Actor::Property::ANCHOR_POINT_Y), targetY ); - } - catch (Dali::DaliException& e) - { - DALI_TEST_PRINT_ASSERT( e ); - DALI_TEST_ASSERT(e, "IsPropertyAnimatable( index )", TEST_LOCATION); - } + }, "Property is not animatable" ); + END_TEST; } -int UtcDaliAnimationAnimateToActorAnchorPointZP(void) +int UtcDaliAnimationAnimateToActorAnchorPointZN(void) { TestApplication application; Actor actor = Actor::New(); Stage::GetCurrent().Add(actor); float startValue(0.5f); - DALI_TEST_EQUALS( actor.GetCurrentAnchorPoint().z, startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT ).z, startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::ANCHOR_POINT_Z), startValue, TEST_LOCATION ); // Build the animation @@ -6439,15 +7052,11 @@ int UtcDaliAnimationAnimateToActorAnchorPointZP(void) Animation animation = Animation::New(durationSeconds); float targetZ(100.0f); - try + DALI_TEST_ASSERTION( { animation.AnimateTo( Property(actor, Actor::Property::ANCHOR_POINT_Z), targetZ ); - } - catch (Dali::DaliException& e) - { - DALI_TEST_PRINT_ASSERT( e ); - DALI_TEST_ASSERT(e, "IsPropertyAnimatable( index )", TEST_LOCATION); - } + }, "Property is not animatable" ); + END_TEST; } @@ -6457,7 +7066,7 @@ int UtcDaliAnimationAnimateToActorSizeP(void) Actor actor = Actor::New(); Stage::GetCurrent().Add(actor); - DALI_TEST_EQUALS( actor.GetCurrentSize(), Vector3::ZERO, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ), Vector3::ZERO, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -6467,9 +7076,21 @@ int UtcDaliAnimationAnimateToActorSizeP(void) Vector3 ninetyNinePercentProgress(targetSize * 0.99f); + // Should return the initial properties before play + DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SIZE ), Vector3::ZERO, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SIZE_WIDTH ), 0.0f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SIZE_HEIGHT ), 0.0f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SIZE_DEPTH ), 0.0f, TEST_LOCATION ); + // Start the animation animation.Play(); + // Should return the target property after play + DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SIZE ), targetSize, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SIZE_WIDTH ), targetSize.width, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SIZE_HEIGHT ), targetSize.height, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SIZE_DEPTH ), targetSize.depth, TEST_LOCATION ); + bool signalReceived(false); AnimationFinishCheck finishCheck(signalReceived); animation.FinishedSignal().Connect(&application, finishCheck); @@ -6480,7 +7101,7 @@ int UtcDaliAnimationAnimateToActorSizeP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentSize(), ninetyNinePercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ), ninetyNinePercentProgress, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*10.0f) + 1u/*just beyond the animation duration*/); @@ -6488,14 +7109,14 @@ int UtcDaliAnimationAnimateToActorSizeP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentSize(), targetSize, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ), targetSize, TEST_LOCATION ); // Reset everything finishCheck.Reset(); actor.SetSize(Vector3::ZERO); application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( actor.GetCurrentSize(), Vector3::ZERO, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ), Vector3::ZERO, TEST_LOCATION ); // Repeat with a different (ease-in) alpha function animation = Animation::New(durationSeconds); @@ -6511,7 +7132,7 @@ int UtcDaliAnimationAnimateToActorSizeP(void) finishCheck.CheckSignalNotReceived(); // The size should have travelled less, than with a linear alpha function - Vector3 current(actor.GetCurrentSize()); + Vector3 current(actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE )); DALI_TEST_CHECK( current.x > 0.0f ); DALI_TEST_CHECK( current.y > 0.0f ); DALI_TEST_CHECK( current.z > 0.0f ); @@ -6525,14 +7146,14 @@ int UtcDaliAnimationAnimateToActorSizeP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentSize(), targetSize, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ), targetSize, TEST_LOCATION ); // Reset everything finishCheck.Reset(); actor.SetSize(Vector3::ZERO); application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( actor.GetCurrentSize(), Vector3::ZERO, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ), Vector3::ZERO, TEST_LOCATION ); // Repeat with a delay float delay = 0.5f; @@ -6547,7 +7168,7 @@ int UtcDaliAnimationAnimateToActorSizeP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentSize(), Vector3::ZERO, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ), Vector3::ZERO, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/); @@ -6555,7 +7176,7 @@ int UtcDaliAnimationAnimateToActorSizeP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentSize(), targetSize, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ), targetSize, TEST_LOCATION ); END_TEST; } @@ -6566,7 +7187,7 @@ int UtcDaliAnimationAnimateToActorSizeWidthP(void) Actor actor = Actor::New(); Stage::GetCurrent().Add(actor); float startValue(0.0f); - DALI_TEST_EQUALS( actor.GetCurrentSize().width, startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).width, startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SIZE_WIDTH), startValue, TEST_LOCATION ); // Build the animation @@ -6577,9 +7198,17 @@ int UtcDaliAnimationAnimateToActorSizeWidthP(void) float fiftyPercentProgress(startValue + (targetWidth - startValue)*0.5f); + // Should return the initial properties before play + DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SIZE ), Vector3::ZERO, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SIZE_WIDTH ), startValue, TEST_LOCATION ); + // Start the animation animation.Play(); + // Should return the target property after play + DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SIZE ), Vector3( targetWidth, 0.0f, 0.0f ), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SIZE_WIDTH ), targetWidth, TEST_LOCATION ); + bool signalReceived(false); AnimationFinishCheck finishCheck(signalReceived); animation.FinishedSignal().Connect(&application, finishCheck); @@ -6590,7 +7219,7 @@ int UtcDaliAnimationAnimateToActorSizeWidthP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentSize().width, fiftyPercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).width, fiftyPercentProgress, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/); @@ -6598,7 +7227,7 @@ int UtcDaliAnimationAnimateToActorSizeWidthP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentSize().width, targetWidth, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).width, targetWidth, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SIZE_WIDTH), targetWidth, TEST_LOCATION ); END_TEST; } @@ -6610,7 +7239,7 @@ int UtcDaliAnimationAnimateToActorSizeHeightP(void) Actor actor = Actor::New(); Stage::GetCurrent().Add(actor); float startValue(0.0f); - DALI_TEST_EQUALS( actor.GetCurrentSize().height, startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).height, startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SIZE_HEIGHT), startValue, TEST_LOCATION ); // Build the animation @@ -6621,9 +7250,17 @@ int UtcDaliAnimationAnimateToActorSizeHeightP(void) float fiftyPercentProgress(startValue + (targetHeight - startValue)*0.5f); + // Should return the initial properties before play + DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SIZE ), Vector3::ZERO, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SIZE_HEIGHT ), startValue, TEST_LOCATION ); + // Start the animation animation.Play(); + // Should return the target property after play + DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SIZE ), Vector3( 0.0f, targetHeight, 0.0f ), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SIZE_HEIGHT ), targetHeight, TEST_LOCATION ); + bool signalReceived(false); AnimationFinishCheck finishCheck(signalReceived); animation.FinishedSignal().Connect(&application, finishCheck); @@ -6634,7 +7271,7 @@ int UtcDaliAnimationAnimateToActorSizeHeightP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentSize().height, fiftyPercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).height, fiftyPercentProgress, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/); @@ -6642,7 +7279,7 @@ int UtcDaliAnimationAnimateToActorSizeHeightP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentSize().height, targetHeight, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).height, targetHeight, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SIZE_HEIGHT), targetHeight, TEST_LOCATION ); END_TEST; } @@ -6654,7 +7291,7 @@ int UtcDaliAnimationAnimateToActorSizeDepthP(void) Actor actor = Actor::New(); Stage::GetCurrent().Add(actor); float startValue(0.0f); - DALI_TEST_EQUALS( actor.GetCurrentSize().depth, startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).depth, startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SIZE_DEPTH), startValue, TEST_LOCATION ); // Build the animation @@ -6665,9 +7302,17 @@ int UtcDaliAnimationAnimateToActorSizeDepthP(void) float fiftyPercentProgress(startValue + (targetDepth - startValue)*0.5f); + // Should return the initial properties before play + DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SIZE ), Vector3::ZERO, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SIZE_DEPTH ), startValue, TEST_LOCATION ); + // Start the animation animation.Play(); + // Should return the target property after play + DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SIZE ), Vector3( 0.0f, 0.0f, targetDepth ), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SIZE_DEPTH ), targetDepth, TEST_LOCATION ); + bool signalReceived(false); AnimationFinishCheck finishCheck(signalReceived); animation.FinishedSignal().Connect(&application, finishCheck); @@ -6678,7 +7323,7 @@ int UtcDaliAnimationAnimateToActorSizeDepthP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentSize().depth, fiftyPercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).depth, fiftyPercentProgress, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/); @@ -6686,7 +7331,7 @@ int UtcDaliAnimationAnimateToActorSizeDepthP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentSize().depth, targetDepth, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).depth, targetDepth, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SIZE_DEPTH), targetDepth, TEST_LOCATION ); END_TEST; } @@ -6697,7 +7342,7 @@ int UtcDaliAnimationAnimateToActorSizeWidthHeightP(void) Actor actor = Actor::New(); Stage::GetCurrent().Add(actor); - DALI_TEST_EQUALS( actor.GetCurrentSize(), Vector3::ZERO, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ), Vector3::ZERO, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -6720,7 +7365,7 @@ int UtcDaliAnimationAnimateToActorSizeWidthHeightP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentSize(), ninetyNinePercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ), ninetyNinePercentProgress, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*10.0f) + 1u/*just beyond the animation duration*/); @@ -6728,14 +7373,14 @@ int UtcDaliAnimationAnimateToActorSizeWidthHeightP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentSize(), targetSize, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ), targetSize, TEST_LOCATION ); // Reset everything finishCheck.Reset(); actor.SetSize(Vector3::ZERO); application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( actor.GetCurrentSize(), Vector3::ZERO, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ), Vector3::ZERO, TEST_LOCATION ); // Repeat with a different (ease-in) alpha function animation = Animation::New(durationSeconds); @@ -6752,7 +7397,7 @@ int UtcDaliAnimationAnimateToActorSizeWidthHeightP(void) finishCheck.CheckSignalNotReceived(); // The size should have travelled less, than with a linear alpha function - Vector3 current(actor.GetCurrentSize()); + Vector3 current(actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE )); DALI_TEST_CHECK( current.x > 0.0f ); DALI_TEST_CHECK( current.y > 0.0f ); DALI_TEST_CHECK( current.x < ninetyNinePercentProgress.x ); @@ -6764,15 +7409,15 @@ int UtcDaliAnimationAnimateToActorSizeWidthHeightP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentSize().x, targetSize.x, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetCurrentSize().y, targetSize.y, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).x, targetSize.x, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).y, targetSize.y, TEST_LOCATION ); // Reset everything finishCheck.Reset(); actor.SetSize(Vector3::ZERO); application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( actor.GetCurrentSize(), Vector3::ZERO, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ), Vector3::ZERO, TEST_LOCATION ); // Repeat with a delay float delay = 0.5f; @@ -6788,7 +7433,7 @@ int UtcDaliAnimationAnimateToActorSizeWidthHeightP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentSize(), Vector3::ZERO, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ), Vector3::ZERO, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/); @@ -6796,8 +7441,8 @@ int UtcDaliAnimationAnimateToActorSizeWidthHeightP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentSize().x, targetSize.x, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetCurrentSize().y, targetSize.y, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).x, targetSize.x, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).y, targetSize.y, TEST_LOCATION ); END_TEST; } @@ -6807,7 +7452,7 @@ int UtcDaliAnimationAnimateToActorPositionP(void) Actor actor = Actor::New(); Stage::GetCurrent().Add(actor); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3::ZERO, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -6817,9 +7462,21 @@ int UtcDaliAnimationAnimateToActorPositionP(void) Vector3 seventyFivePercentProgress(targetPosition * 0.75f); + // Should return the initial properties before play + DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_X ), 0.0f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_Y ), 0.0f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_Z ), 0.0f, TEST_LOCATION ); + // Start the animation animation.Play(); + // Should return the target property after play + DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_X ), targetPosition.x, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_Y ), targetPosition.y, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_Z ), targetPosition.z, TEST_LOCATION ); + bool signalReceived(false); AnimationFinishCheck finishCheck(signalReceived); animation.FinishedSignal().Connect(&application, finishCheck); @@ -6830,7 +7487,7 @@ int UtcDaliAnimationAnimateToActorPositionP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), seventyFivePercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), seventyFivePercentProgress, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/); @@ -6838,7 +7495,7 @@ int UtcDaliAnimationAnimateToActorPositionP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); END_TEST; } @@ -6849,7 +7506,7 @@ int UtcDaliAnimationAnimateToActorPositionXP(void) Actor actor = Actor::New(); Stage::GetCurrent().Add(actor); float startValue(0.0f); - DALI_TEST_EQUALS( actor.GetCurrentPosition().x, startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ).x, startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_X), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_Y), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_Z), startValue, TEST_LOCATION ); @@ -6862,9 +7519,17 @@ int UtcDaliAnimationAnimateToActorPositionXP(void) float fiftyPercentProgress(startValue + (targetX - startValue)*0.5f); + // Should return the initial properties before play + DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_X ), startValue, TEST_LOCATION ); + // Start the animation animation.Play(); + // Should return the target property after play + DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), Vector3( targetX, 0.0f, 0.0f ), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_X ), targetX, TEST_LOCATION ); + bool signalReceived(false); AnimationFinishCheck finishCheck(signalReceived); animation.FinishedSignal().Connect(&application, finishCheck); @@ -6875,7 +7540,7 @@ int UtcDaliAnimationAnimateToActorPositionXP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition().x, fiftyPercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ).x, fiftyPercentProgress, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/); @@ -6883,7 +7548,7 @@ int UtcDaliAnimationAnimateToActorPositionXP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition().x, targetX, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ).x, targetX, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_X), targetX, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_Y), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_Z), startValue, TEST_LOCATION ); @@ -6897,7 +7562,7 @@ int UtcDaliAnimationAnimateToActorPositionYP(void) Actor actor = Actor::New(); Stage::GetCurrent().Add(actor); float startValue(0.0f); - DALI_TEST_EQUALS( actor.GetCurrentPosition().y, startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ).y, startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_X), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_Y), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_Z), startValue, TEST_LOCATION ); @@ -6910,9 +7575,17 @@ int UtcDaliAnimationAnimateToActorPositionYP(void) float fiftyPercentProgress(startValue + (targetY - startValue)*0.5f); + // Should return the initial properties before play + DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_Y ), startValue, TEST_LOCATION ); + // Start the animation animation.Play(); + // Should return the target property after play + DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), Vector3( 0.0f, targetY, 0.0f ), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_Y ), targetY, TEST_LOCATION ); + bool signalReceived(false); AnimationFinishCheck finishCheck(signalReceived); animation.FinishedSignal().Connect(&application, finishCheck); @@ -6923,7 +7596,7 @@ int UtcDaliAnimationAnimateToActorPositionYP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition().y, fiftyPercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ).y, fiftyPercentProgress, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/); @@ -6931,7 +7604,7 @@ int UtcDaliAnimationAnimateToActorPositionYP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition().y, targetY, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ).y, targetY, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_X), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_Y), targetY, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_Z), startValue, TEST_LOCATION ); @@ -6945,7 +7618,7 @@ int UtcDaliAnimationAnimateToActorPositionZP(void) Actor actor = Actor::New(); Stage::GetCurrent().Add(actor); float startValue(0.0f); - DALI_TEST_EQUALS( actor.GetCurrentPosition().z, startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ).z, startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_X), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_Y), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_Z), startValue, TEST_LOCATION ); @@ -6958,9 +7631,17 @@ int UtcDaliAnimationAnimateToActorPositionZP(void) float fiftyPercentProgress(startValue + (targetZ - startValue)*0.5f); + // Should return the initial properties before play + DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_Z ), startValue, TEST_LOCATION ); + // Start the animation animation.Play(); + // Should return the target property after play + DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, targetZ ), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_Z ), targetZ, TEST_LOCATION ); + bool signalReceived(false); AnimationFinishCheck finishCheck(signalReceived); animation.FinishedSignal().Connect(&application, finishCheck); @@ -6971,7 +7652,7 @@ int UtcDaliAnimationAnimateToActorPositionZP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition().z, fiftyPercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ).z, fiftyPercentProgress, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/); @@ -6979,7 +7660,7 @@ int UtcDaliAnimationAnimateToActorPositionZP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition().z, targetZ, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ).z, targetZ, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_X), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_Y), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_Z), targetZ, TEST_LOCATION ); @@ -6992,7 +7673,7 @@ int UtcDaliAnimationAnimateToActorPositionAlphaFunctionP(void) Actor actor = Actor::New(); Stage::GetCurrent().Add(actor); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3::ZERO, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -7017,7 +7698,7 @@ int UtcDaliAnimationAnimateToActorPositionAlphaFunctionP(void) finishCheck.CheckSignalNotReceived(); // The position should have moved less, than with a linear alpha function - Vector3 current(actor.GetCurrentPosition()); + Vector3 current(actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION )); DALI_TEST_CHECK( current.x > Vector3::ZERO.x ); DALI_TEST_CHECK( current.y > Vector3::ZERO.y ); DALI_TEST_CHECK( current.z > Vector3::ZERO.z ); @@ -7031,7 +7712,7 @@ int UtcDaliAnimationAnimateToActorPositionAlphaFunctionP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); END_TEST; } @@ -7041,7 +7722,7 @@ int UtcDaliAnimationAnimateToActorPositionTimePeriodP(void) Actor actor = Actor::New(); Stage::GetCurrent().Add(actor); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3::ZERO, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -7067,7 +7748,7 @@ int UtcDaliAnimationAnimateToActorPositionTimePeriodP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3::ZERO, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*500.0f*0.75)/* 7/8 animation progress, 3/4 animator progress */); @@ -7075,7 +7756,7 @@ int UtcDaliAnimationAnimateToActorPositionTimePeriodP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), seventyFivePercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), seventyFivePercentProgress, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*500.0f*0.25) + 1u/*just beyond the animation duration*/); @@ -7083,7 +7764,7 @@ int UtcDaliAnimationAnimateToActorPositionTimePeriodP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); END_TEST; } @@ -7093,7 +7774,7 @@ int UtcDaliAnimationAnimateToActorPositionAlphaFunctionTimePeriodP(void) Actor actor = Actor::New(); Stage::GetCurrent().Add(actor); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3::ZERO, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -7120,7 +7801,7 @@ int UtcDaliAnimationAnimateToActorPositionAlphaFunctionTimePeriodP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3::ZERO, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*500.0f*0.75)/* 7/8 animation progress, 3/4 animator progress */); @@ -7128,7 +7809,7 @@ int UtcDaliAnimationAnimateToActorPositionAlphaFunctionTimePeriodP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), seventyFivePercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), seventyFivePercentProgress, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*500.0f*0.25) + 1u/*just beyond the animation duration*/); @@ -7136,7 +7817,7 @@ int UtcDaliAnimationAnimateToActorPositionAlphaFunctionTimePeriodP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); END_TEST; } @@ -7145,9 +7826,9 @@ int UtcDaliAnimationAnimateToActorOrientationAngleAxisP(void) TestApplication application; Actor actor = Actor::New(); - actor.SetOrientation(Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) ); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) ); Stage::GetCurrent().Add(actor); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion( Dali::ANGLE_0, Vector3::YAXIS ), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::YAXIS ), ROTATION_EPSILON, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -7159,6 +7840,9 @@ int UtcDaliAnimationAnimateToActorOrientationAngleAxisP(void) // Start the animation animation.Play(); + // Target value should be retrievable straight away + DALI_TEST_EQUALS( actor.GetProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(targetRotationRadians, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); + bool signalReceived(false); AnimationFinishCheck finishCheck(signalReceived); animation.FinishedSignal().Connect(&application, finishCheck); @@ -7169,7 +7853,7 @@ int UtcDaliAnimationAnimateToActorOrientationAngleAxisP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * 0.25f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(targetRotationRadians * 0.25f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f)/* 50% progress */); @@ -7177,7 +7861,7 @@ int UtcDaliAnimationAnimateToActorOrientationAngleAxisP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * 0.5f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(targetRotationRadians * 0.5f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f)/* 75% progress */); @@ -7185,7 +7869,7 @@ int UtcDaliAnimationAnimateToActorOrientationAngleAxisP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * 0.75f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(targetRotationRadians * 0.75f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/); @@ -7193,7 +7877,7 @@ int UtcDaliAnimationAnimateToActorOrientationAngleAxisP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(targetRotationRadians, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); END_TEST; } @@ -7202,9 +7886,9 @@ int UtcDaliAnimationAnimateToActorOrientationQuaternionP(void) TestApplication application; Actor actor = Actor::New(); - actor.SetOrientation(Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) ); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) ); Stage::GetCurrent().Add(actor); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion( Dali::ANGLE_0, Vector3::YAXIS ), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::YAXIS ), ROTATION_EPSILON, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -7227,7 +7911,7 @@ int UtcDaliAnimationAnimateToActorOrientationQuaternionP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * 0.25f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(targetRotationRadians * 0.25f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f)/* 50% progress */); @@ -7235,7 +7919,7 @@ int UtcDaliAnimationAnimateToActorOrientationQuaternionP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * 0.5f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(targetRotationRadians * 0.5f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f)/* 75% progress */); @@ -7243,7 +7927,7 @@ int UtcDaliAnimationAnimateToActorOrientationQuaternionP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * 0.75f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(targetRotationRadians * 0.75f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/); @@ -7251,7 +7935,7 @@ int UtcDaliAnimationAnimateToActorOrientationQuaternionP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(targetRotationRadians, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); END_TEST; } @@ -7260,9 +7944,9 @@ int UtcDaliAnimationAnimateToActorOrientationAlphaFunctionP(void) TestApplication application; Actor actor = Actor::New(); - actor.SetOrientation(Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) ); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) ); Stage::GetCurrent().Add(actor); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(Radian(0.0f), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(Radian(0.0f), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -7284,7 +7968,7 @@ int UtcDaliAnimationAnimateToActorOrientationAlphaFunctionP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * 0.25f*0.25f*0.25f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(targetRotationRadians * 0.25f*0.25f*0.25f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f)/* 50% progress */); @@ -7292,7 +7976,7 @@ int UtcDaliAnimationAnimateToActorOrientationAlphaFunctionP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * 0.5f*0.5f*0.5f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(targetRotationRadians * 0.5f*0.5f*0.5f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f)/* 75% progress */); @@ -7300,7 +7984,7 @@ int UtcDaliAnimationAnimateToActorOrientationAlphaFunctionP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * 0.75f*0.75f*0.75f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(targetRotationRadians * 0.75f*0.75f*0.75f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/); @@ -7308,7 +7992,7 @@ int UtcDaliAnimationAnimateToActorOrientationAlphaFunctionP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(targetRotationRadians, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); END_TEST; } @@ -7317,9 +8001,9 @@ int UtcDaliAnimationAnimateToActorOrientationTimePeriodP(void) TestApplication application; Actor actor = Actor::New(); - actor.SetOrientation(Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) ); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) ); Stage::GetCurrent().Add(actor); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion( Dali::ANGLE_0, Vector3::YAXIS ), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::YAXIS ), ROTATION_EPSILON, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -7343,7 +8027,7 @@ int UtcDaliAnimationAnimateToActorOrientationTimePeriodP(void) application.SendNotification(); finishCheck.CheckSignalNotReceived(); float progress = max(0.0f, 0.25f - delay) / (1.0f - delay); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * progress, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(targetRotationRadians * progress, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f)/* 50% progress */); @@ -7352,7 +8036,7 @@ int UtcDaliAnimationAnimateToActorOrientationTimePeriodP(void) application.SendNotification(); finishCheck.CheckSignalNotReceived(); progress = max(0.0f, 0.5f - delay) / (1.0f - delay); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * progress, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(targetRotationRadians * progress, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f)/* 75% progress */); @@ -7361,7 +8045,7 @@ int UtcDaliAnimationAnimateToActorOrientationTimePeriodP(void) application.SendNotification(); finishCheck.CheckSignalNotReceived(); progress = max(0.0f, 0.75f - delay) / (1.0f - delay); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * progress, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(targetRotationRadians * progress, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/); @@ -7369,7 +8053,7 @@ int UtcDaliAnimationAnimateToActorOrientationTimePeriodP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(targetRotationRadians, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); END_TEST; } @@ -7378,9 +8062,9 @@ int UtcDaliAnimationAnimateToActorOrientationAlphaFunctionTimePeriodP(void) TestApplication application; Actor actor = Actor::New(); - actor.SetOrientation(Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) ); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) ); Stage::GetCurrent().Add(actor); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion( Dali::ANGLE_0, Vector3::YAXIS ), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::YAXIS ), ROTATION_EPSILON, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -7404,7 +8088,7 @@ int UtcDaliAnimationAnimateToActorOrientationAlphaFunctionTimePeriodP(void) application.SendNotification(); finishCheck.CheckSignalNotReceived(); float progress = max(0.0f, 0.25f - delay) / (1.0f - delay); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * progress*progress*progress, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(targetRotationRadians * progress*progress*progress, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f)/* 50% progress */); @@ -7413,7 +8097,7 @@ int UtcDaliAnimationAnimateToActorOrientationAlphaFunctionTimePeriodP(void) application.SendNotification(); finishCheck.CheckSignalNotReceived(); progress = max(0.0f, 0.5f - delay) / (1.0f - delay); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * progress*progress*progress, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(targetRotationRadians * progress*progress*progress, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f)/* 75% progress */); @@ -7422,7 +8106,7 @@ int UtcDaliAnimationAnimateToActorOrientationAlphaFunctionTimePeriodP(void) application.SendNotification(); finishCheck.CheckSignalNotReceived(); progress = max(0.0f, 0.75f - delay) / (1.0f - delay); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * progress*progress*progress, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(targetRotationRadians * progress*progress*progress, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/); @@ -7430,7 +8114,7 @@ int UtcDaliAnimationAnimateToActorOrientationAlphaFunctionTimePeriodP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(targetRotationRadians, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION ); END_TEST; } @@ -7440,7 +8124,7 @@ int UtcDaliAnimationAnimateToActorScaleP(void) Actor actor = Actor::New(); Stage::GetCurrent().Add(actor); - DALI_TEST_EQUALS( actor.GetCurrentScale(), Vector3::ONE, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ), Vector3::ONE, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -7453,6 +8137,12 @@ int UtcDaliAnimationAnimateToActorScaleP(void) // Start the animation animation.Play(); + // Target value should be retrievable straight away + DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SCALE ), targetScale, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SCALE_X ), targetScale.x, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SCALE_Y ), targetScale.y, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SCALE_Z ), targetScale.z, TEST_LOCATION ); + bool signalReceived(false); AnimationFinishCheck finishCheck(signalReceived); animation.FinishedSignal().Connect(&application, finishCheck); @@ -7463,7 +8153,7 @@ int UtcDaliAnimationAnimateToActorScaleP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentScale(), ninetyNinePercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ), ninetyNinePercentProgress, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*10.0f) + 1u/*just beyond the animation duration*/); @@ -7471,14 +8161,14 @@ int UtcDaliAnimationAnimateToActorScaleP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentScale(), targetScale, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ), targetScale, TEST_LOCATION ); // Reset everything finishCheck.Reset(); actor.SetScale(Vector3::ONE); application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( actor.GetCurrentScale(), Vector3::ONE, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ), Vector3::ONE, TEST_LOCATION ); // Repeat with a different (ease-in) alpha function animation = Animation::New(durationSeconds); @@ -7494,7 +8184,7 @@ int UtcDaliAnimationAnimateToActorScaleP(void) finishCheck.CheckSignalNotReceived(); // The scale should have grown less, than with a linear alpha function - Vector3 current(actor.GetCurrentScale()); + Vector3 current(actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE )); DALI_TEST_CHECK( current.x > 1.0f ); DALI_TEST_CHECK( current.y > 1.0f ); DALI_TEST_CHECK( current.z > 1.0f ); @@ -7508,14 +8198,14 @@ int UtcDaliAnimationAnimateToActorScaleP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentScale(), targetScale, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ), targetScale, TEST_LOCATION ); // Reset everything finishCheck.Reset(); actor.SetScale(Vector3::ONE); application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( actor.GetCurrentScale(), Vector3::ONE, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ), Vector3::ONE, TEST_LOCATION ); // Repeat with a delay float delay = 0.5f; @@ -7530,7 +8220,7 @@ int UtcDaliAnimationAnimateToActorScaleP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentScale(), Vector3::ONE, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ), Vector3::ONE, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/); @@ -7538,7 +8228,7 @@ int UtcDaliAnimationAnimateToActorScaleP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentScale(), targetScale, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ), targetScale, TEST_LOCATION ); END_TEST; } @@ -7549,10 +8239,13 @@ int UtcDaliAnimationAnimateToActorScaleXP(void) Actor actor = Actor::New(); Stage::GetCurrent().Add(actor); float startValue(1.0f); - DALI_TEST_EQUALS( actor.GetCurrentScale().x, startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ).x, startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SCALE_X), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SCALE_Y), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SCALE_Z), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::SCALE_X ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::SCALE_Y ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::SCALE_Z ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -7565,6 +8258,10 @@ int UtcDaliAnimationAnimateToActorScaleXP(void) // Start the animation animation.Play(); + // Target value should be retrievable straight away + DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SCALE ), Vector3( targetX, startValue, startValue ), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SCALE_X ), targetX, TEST_LOCATION ); + bool signalReceived(false); AnimationFinishCheck finishCheck(signalReceived); animation.FinishedSignal().Connect(&application, finishCheck); @@ -7575,10 +8272,10 @@ int UtcDaliAnimationAnimateToActorScaleXP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentScale().x, fiftyPercentProgress, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SCALE_X), fiftyPercentProgress, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SCALE_Y), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SCALE_Z), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ).x, fiftyPercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::SCALE_X ), fiftyPercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::SCALE_Y ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::SCALE_Z ), startValue, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/); @@ -7586,10 +8283,10 @@ int UtcDaliAnimationAnimateToActorScaleXP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentScale().x, targetX, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SCALE_X), targetX, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SCALE_Y), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SCALE_Z), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ).x, targetX, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::SCALE_X ), targetX, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::SCALE_Y ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::SCALE_Z ), startValue, TEST_LOCATION ); END_TEST; } @@ -7600,10 +8297,13 @@ int UtcDaliAnimationAnimateToActorScaleYP(void) Actor actor = Actor::New(); Stage::GetCurrent().Add(actor); float startValue(1.0f); - DALI_TEST_EQUALS( actor.GetCurrentScale().y, startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ).y, startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SCALE_X), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SCALE_Y), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SCALE_Z), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::SCALE_X ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::SCALE_Y ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::SCALE_Z ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -7616,6 +8316,10 @@ int UtcDaliAnimationAnimateToActorScaleYP(void) // Start the animation animation.Play(); + // Target value should be retrievable straight away + DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SCALE ), Vector3( startValue, targetY, startValue ), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SCALE_Y ), targetY, TEST_LOCATION ); + bool signalReceived(false); AnimationFinishCheck finishCheck(signalReceived); animation.FinishedSignal().Connect(&application, finishCheck); @@ -7626,10 +8330,10 @@ int UtcDaliAnimationAnimateToActorScaleYP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentScale().y, fiftyPercentProgress, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SCALE_X), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SCALE_Y), fiftyPercentProgress, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SCALE_Z), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ).y, fiftyPercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::SCALE_X ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::SCALE_Y ), fiftyPercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::SCALE_Z ), startValue, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/); @@ -7637,10 +8341,10 @@ int UtcDaliAnimationAnimateToActorScaleYP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentScale().y, targetY, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SCALE_X), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SCALE_Y), targetY, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SCALE_Z), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ).y, targetY, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::SCALE_X ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::SCALE_Y ), targetY, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::SCALE_Z ), startValue, TEST_LOCATION ); END_TEST; } @@ -7651,10 +8355,13 @@ int UtcDaliAnimationAnimateToActorScaleZP(void) Actor actor = Actor::New(); Stage::GetCurrent().Add(actor); float startValue(1.0f); - DALI_TEST_EQUALS( actor.GetCurrentScale().z, startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ).z, startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SCALE_X), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SCALE_Y), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SCALE_Z), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::SCALE_X ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::SCALE_Y ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::SCALE_Z ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -7667,6 +8374,10 @@ int UtcDaliAnimationAnimateToActorScaleZP(void) // Start the animation animation.Play(); + // Target value should be retrievable straight away + DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SCALE ), Vector3( startValue, startValue, targetZ ), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SCALE_Z ), targetZ, TEST_LOCATION ); + bool signalReceived(false); AnimationFinishCheck finishCheck(signalReceived); animation.FinishedSignal().Connect(&application, finishCheck); @@ -7677,10 +8388,10 @@ int UtcDaliAnimationAnimateToActorScaleZP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentScale().z, fiftyPercentProgress, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SCALE_X), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SCALE_Y), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SCALE_Z), fiftyPercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ).z, fiftyPercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::SCALE_X ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::SCALE_Y ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::SCALE_Z ), fiftyPercentProgress, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/); @@ -7688,10 +8399,10 @@ int UtcDaliAnimationAnimateToActorScaleZP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentScale().z, targetZ, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SCALE_X), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SCALE_Y), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SCALE_Z), targetZ, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ).z, targetZ, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::SCALE_X ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::SCALE_Y ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::SCALE_Z ), targetZ, TEST_LOCATION ); END_TEST; } @@ -7701,7 +8412,7 @@ int UtcDaliAnimationAnimateToActorColorP(void) Actor actor = Actor::New(); Stage::GetCurrent().Add(actor); - DALI_TEST_EQUALS( actor.GetCurrentColor(), Color::WHITE, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), Color::WHITE, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -7715,6 +8426,14 @@ int UtcDaliAnimationAnimateToActorColorP(void) // Start the animation animation.Play(); + // Target value should be retrievable straight away + DALI_TEST_EQUALS( actor.GetProperty< Vector4 >( Actor::Property::COLOR ), targetColor, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::COLOR_RED ), targetColor.r, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::COLOR_GREEN ), targetColor.g, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::COLOR_BLUE ), targetColor.b, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::COLOR_ALPHA ), targetColor.a, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( DevelActor::Property::OPACITY ), targetColor.a, TEST_LOCATION ); + bool signalReceived(false); AnimationFinishCheck finishCheck(signalReceived); animation.FinishedSignal().Connect(&application, finishCheck); @@ -7725,7 +8444,7 @@ int UtcDaliAnimationAnimateToActorColorP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentColor(), tenPercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), tenPercentProgress, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*900.0f) + 1u/*just beyond the animation duration*/); @@ -7733,14 +8452,14 @@ int UtcDaliAnimationAnimateToActorColorP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentColor(), targetColor, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), targetColor, TEST_LOCATION ); // Reset everything finishCheck.Reset(); - actor.SetColor(Color::WHITE); + actor.SetProperty( Actor::Property::COLOR,Color::WHITE); application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( actor.GetCurrentColor(), Color::WHITE, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), Color::WHITE, TEST_LOCATION ); // Repeat with a different (ease-in) alpha function animation = Animation::New(durationSeconds); @@ -7756,7 +8475,7 @@ int UtcDaliAnimationAnimateToActorColorP(void) finishCheck.CheckSignalNotReceived(); // The color should have changed less, than with a linear alpha function - Vector4 current(actor.GetCurrentColor()); + Vector4 current(actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR )); DALI_TEST_CHECK( current.x == 1.0f ); // doesn't change DALI_TEST_CHECK( current.y < 1.0f ); DALI_TEST_CHECK( current.y > tenPercentProgress.y ); @@ -7770,14 +8489,14 @@ int UtcDaliAnimationAnimateToActorColorP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentColor(), targetColor, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), targetColor, TEST_LOCATION ); // Reset everything finishCheck.Reset(); - actor.SetColor(Color::WHITE); + actor.SetProperty( Actor::Property::COLOR,Color::WHITE); application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( actor.GetCurrentColor(), Color::WHITE, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), Color::WHITE, TEST_LOCATION ); // Repeat with a shorter animator duration float animatorDuration = 0.5f; @@ -7792,7 +8511,7 @@ int UtcDaliAnimationAnimateToActorColorP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentColor(), twentyPercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), twentyPercentProgress, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*400.0f)/* 50% animation progress, 100% animator progress */); @@ -7800,7 +8519,7 @@ int UtcDaliAnimationAnimateToActorColorP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentColor(), targetColor, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), targetColor, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/); @@ -7808,7 +8527,7 @@ int UtcDaliAnimationAnimateToActorColorP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentColor(), targetColor, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), targetColor, TEST_LOCATION ); END_TEST; } @@ -7819,11 +8538,15 @@ int UtcDaliAnimationAnimateToActorColorRedP(void) Actor actor = Actor::New(); Stage::GetCurrent().Add(actor); float startValue(1.0f); - DALI_TEST_EQUALS( actor.GetCurrentColor().r, startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).r, startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -7836,6 +8559,10 @@ int UtcDaliAnimationAnimateToActorColorRedP(void) // Start the animation animation.Play(); + // Target value should be retrievable straight away + DALI_TEST_EQUALS( actor.GetProperty< Vector4 >( Actor::Property::COLOR ), Vector4( targetRed, startValue, startValue, startValue ), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::COLOR_RED ), targetRed, TEST_LOCATION ); + bool signalReceived(false); AnimationFinishCheck finishCheck(signalReceived); animation.FinishedSignal().Connect(&application, finishCheck); @@ -7846,11 +8573,11 @@ int UtcDaliAnimationAnimateToActorColorRedP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentColor().r, fiftyPercentProgress, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), fiftyPercentProgress, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).r, fiftyPercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED), fiftyPercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA), startValue, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/); @@ -7858,11 +8585,11 @@ int UtcDaliAnimationAnimateToActorColorRedP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentColor().r, targetRed, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), targetRed, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).r, targetRed, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED), targetRed, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA), startValue, TEST_LOCATION ); END_TEST; } @@ -7873,11 +8600,15 @@ int UtcDaliAnimationAnimateToActorColorGreenP(void) Actor actor = Actor::New(); Stage::GetCurrent().Add(actor); float startValue(1.0f); - DALI_TEST_EQUALS( actor.GetCurrentColor().g, startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).g, startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -7890,6 +8621,10 @@ int UtcDaliAnimationAnimateToActorColorGreenP(void) // Start the animation animation.Play(); + // Target value should be retrievable straight away + DALI_TEST_EQUALS( actor.GetProperty< Vector4 >( Actor::Property::COLOR ), Vector4( startValue, targetGreen, startValue, startValue ), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::COLOR_GREEN ), targetGreen, TEST_LOCATION ); + bool signalReceived(false); AnimationFinishCheck finishCheck(signalReceived); animation.FinishedSignal().Connect(&application, finishCheck); @@ -7900,11 +8635,11 @@ int UtcDaliAnimationAnimateToActorColorGreenP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentColor().g, fiftyPercentProgress, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), fiftyPercentProgress, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).g, fiftyPercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN), fiftyPercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA), startValue, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/); @@ -7912,11 +8647,11 @@ int UtcDaliAnimationAnimateToActorColorGreenP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentColor().g, targetGreen, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), targetGreen, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).g, targetGreen, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN), targetGreen, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA), startValue, TEST_LOCATION ); END_TEST; } @@ -7927,11 +8662,15 @@ int UtcDaliAnimationAnimateToActorColorBlueP(void) Actor actor = Actor::New(); Stage::GetCurrent().Add(actor); float startValue(1.0f); - DALI_TEST_EQUALS( actor.GetCurrentColor().b, startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).b, startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -7944,6 +8683,10 @@ int UtcDaliAnimationAnimateToActorColorBlueP(void) // Start the animation animation.Play(); + // Target value should be retrievable straight away + DALI_TEST_EQUALS( actor.GetProperty< Vector4 >( Actor::Property::COLOR ), Vector4( startValue, startValue, targetBlue, startValue ), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::COLOR_BLUE ), targetBlue, TEST_LOCATION ); + bool signalReceived(false); AnimationFinishCheck finishCheck(signalReceived); animation.FinishedSignal().Connect(&application, finishCheck); @@ -7954,11 +8697,11 @@ int UtcDaliAnimationAnimateToActorColorBlueP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentColor().b, fiftyPercentProgress, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), fiftyPercentProgress, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).b, fiftyPercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), fiftyPercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), startValue, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/); @@ -7966,11 +8709,11 @@ int UtcDaliAnimationAnimateToActorColorBlueP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentColor().b, targetBlue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), targetBlue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).b, targetBlue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), targetBlue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), startValue, TEST_LOCATION ); END_TEST; } @@ -7981,11 +8724,15 @@ int UtcDaliAnimationAnimateToActorColorAlphaP(void) Actor actor = Actor::New(); Stage::GetCurrent().Add(actor); float startValue(1.0f); - DALI_TEST_EQUALS( actor.GetCurrentColor().a, startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).a, startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -7998,6 +8745,11 @@ int UtcDaliAnimationAnimateToActorColorAlphaP(void) // Start the animation animation.Play(); + // Target value should be retrievable straight away + DALI_TEST_EQUALS( actor.GetProperty< Vector4 >( Actor::Property::COLOR ), Vector4( startValue, startValue, startValue, targetAlpha ), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::COLOR_ALPHA ), targetAlpha, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( DevelActor::Property::OPACITY ), targetAlpha, TEST_LOCATION ); + bool signalReceived(false); AnimationFinishCheck finishCheck(signalReceived); animation.FinishedSignal().Connect(&application, finishCheck); @@ -8008,11 +8760,11 @@ int UtcDaliAnimationAnimateToActorColorAlphaP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentColor().a, fiftyPercentProgress, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), fiftyPercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).a, fiftyPercentProgress, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), fiftyPercentProgress, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/); @@ -8020,11 +8772,11 @@ int UtcDaliAnimationAnimateToActorColorAlphaP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetCurrentColor().a, targetAlpha, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), targetAlpha, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).a, targetAlpha, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), targetAlpha, TEST_LOCATION ); END_TEST; } @@ -8055,7 +8807,7 @@ int UtcDaliAnimationKeyFrames01P(void) END_TEST; } -int UtcDaliAnimationKeyFrames02P(void) +int UtcDaliAnimationKeyFrames02N(void) { TestApplication application; @@ -8071,19 +8823,15 @@ int UtcDaliAnimationKeyFrames02P(void) DALI_TEST_EQUALS(keyFrames.GetType(), Property::FLOAT, TEST_LOCATION); - try + DALI_TEST_ASSERTION( { keyFrames.Add(1.9f, false); - } - catch (Dali::DaliException& e) - { - DALI_TEST_PRINT_ASSERT( e ); - DALI_TEST_ASSERT(e, "mType == value.GetType()", TEST_LOCATION); - } + }, "mType == value.GetType()" ); + END_TEST; } -int UtcDaliAnimationKeyFrames03P(void) +int UtcDaliAnimationKeyFrames03N(void) { TestApplication application; @@ -8099,19 +8847,15 @@ int UtcDaliAnimationKeyFrames03P(void) DALI_TEST_EQUALS(keyFrames.GetType(), Property::BOOLEAN, TEST_LOCATION); - try + DALI_TEST_ASSERTION( { keyFrames.Add(0.7f, Vector3(1.0f, 1.0f, 1.0f)); - } - catch (Dali::DaliException& e) - { - DALI_TEST_PRINT_ASSERT( e ); - DALI_TEST_ASSERT(e, "mType == value.GetType()", TEST_LOCATION); - } + }, "mType == value.GetType()" ); + END_TEST; } -int UtcDaliAnimationKeyFrames04P(void) +int UtcDaliAnimationKeyFrames04N(void) { TestApplication application; @@ -8127,19 +8871,15 @@ int UtcDaliAnimationKeyFrames04P(void) DALI_TEST_EQUALS(keyFrames.GetType(), Property::VECTOR2, TEST_LOCATION); - try + DALI_TEST_ASSERTION( { keyFrames.Add(0.7f, Vector3(1.0f, 1.0f, 1.0f)); - } - catch (Dali::DaliException& e) - { - DALI_TEST_PRINT_ASSERT( e ); - DALI_TEST_ASSERT(e, "mType == value.GetType()", TEST_LOCATION); - } + }, "mType == value.GetType()" ); + END_TEST; } -int UtcDaliAnimationKeyFrames05P(void) +int UtcDaliAnimationKeyFrames05N(void) { TestApplication application; @@ -8155,19 +8895,15 @@ int UtcDaliAnimationKeyFrames05P(void) DALI_TEST_EQUALS(keyFrames.GetType(), Property::VECTOR3, TEST_LOCATION); - try + DALI_TEST_ASSERTION( { keyFrames.Add(0.7f, 1.0f); - } - catch (Dali::DaliException& e) - { - DALI_TEST_PRINT_ASSERT( e ); - DALI_TEST_ASSERT(e, "mType == value.GetType()", TEST_LOCATION); - } + }, "mType == value.GetType()" ); + END_TEST; } -int UtcDaliAnimationKeyFrames06P(void) +int UtcDaliAnimationKeyFrames06N(void) { TestApplication application; @@ -8183,19 +8919,15 @@ int UtcDaliAnimationKeyFrames06P(void) DALI_TEST_EQUALS(keyFrames.GetType(), Property::VECTOR4, TEST_LOCATION); - try + DALI_TEST_ASSERTION( { keyFrames.Add(0.7f, Quaternion(Radian(1.717f), Vector3::XAXIS)); - } - catch (Dali::DaliException& e) - { - DALI_TEST_PRINT_ASSERT( e ); - DALI_TEST_ASSERT(e, "mType == value.GetType()", TEST_LOCATION); - } + }, "mType == value.GetType()" ); + END_TEST; } -int UtcDaliAnimationKeyFrames07P(void) +int UtcDaliAnimationKeyFrames07N(void) { TestApplication application; @@ -8211,15 +8943,11 @@ int UtcDaliAnimationKeyFrames07P(void) DALI_TEST_EQUALS(keyFrames.GetType(), Property::ROTATION, TEST_LOCATION); - try + DALI_TEST_ASSERTION( { keyFrames.Add(0.7f, 1.1f); - } - catch (Dali::DaliException& e) - { - DALI_TEST_PRINT_ASSERT( e ); - DALI_TEST_ASSERT(e, "mType == value.GetType()", TEST_LOCATION); - } + }, "mType == value.GetType()" ); + END_TEST; } @@ -8229,14 +8957,18 @@ int UtcDaliAnimationAnimateBetweenActorColorAlphaP(void) float startValue(1.0f); Actor actor = Actor::New(); - actor.SetColor(Vector4(startValue, startValue, startValue, startValue)); + actor.SetProperty( Actor::Property::COLOR,Vector4(startValue, startValue, startValue, startValue)); Stage::GetCurrent().Add(actor); - DALI_TEST_EQUALS( actor.GetCurrentColor().a, startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).a, startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -8255,6 +8987,9 @@ int UtcDaliAnimationAnimateBetweenActorColorAlphaP(void) // Start the animation animation.Play(); + // Final key frame value should be retrievable straight away + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::COLOR_ALPHA ), 0.9f, TEST_LOCATION ); + bool signalReceived(false); AnimationFinishCheck finishCheck(signalReceived); animation.FinishedSignal().Connect(&application, finishCheck); @@ -8262,55 +8997,55 @@ int UtcDaliAnimationAnimateBetweenActorColorAlphaP(void) application.Render(0); application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentColor().a, 0.1f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).a, 0.1f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*100.0f)/* 10% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 0.3f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetCurrentColor().a, 0.3f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA), 0.3f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).a, 0.3f, 0.01f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*200.0f)/* 30% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 0.25f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetCurrentColor().a, 0.25f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA), 0.25f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).a, 0.25f, 0.01f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*100.0f)/* 40% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 0.0f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetCurrentColor().a, 0.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA), 0.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).a, 0.0f, 0.01f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*400.0f)/* 80% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 0.7f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetCurrentColor().a, 0.7f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA), 0.7f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).a, 0.7f, 0.01f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*100.0f)/* 90% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 0.8f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetCurrentColor().a, 0.8f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA), 0.8f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).a, 0.8f, 0.01f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*100.0f)+1/* 100% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 0.9f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetCurrentColor().a, 0.9f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA), 0.9f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).a, 0.9f, 0.01f, TEST_LOCATION ); // We did expect the animation to finish @@ -8324,14 +9059,18 @@ int UtcDaliAnimationAnimateBetweenActorColorAlphaCubicP(void) float startValue(1.0f); Actor actor = Actor::New(); - actor.SetColor(Vector4(startValue, startValue, startValue, startValue)); + actor.SetProperty( Actor::Property::COLOR,Vector4(startValue, startValue, startValue, startValue)); Stage::GetCurrent().Add(actor); - DALI_TEST_EQUALS( actor.GetCurrentColor().a, startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).a, startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -8357,55 +9096,55 @@ int UtcDaliAnimationAnimateBetweenActorColorAlphaCubicP(void) application.Render(0); application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetCurrentColor().a, 0.1f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).a, 0.1f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*100.0f)/* 10% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 0.36f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetCurrentColor().a, 0.36f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), 0.36f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).a, 0.36f, 0.01f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*200.0f)/* 30% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 0.21f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetCurrentColor().a, 0.21f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), 0.21f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).a, 0.21f, 0.01f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*100.0f)/* 40% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 0.0f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetCurrentColor().a, 0.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), 0.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).a, 0.0f, 0.01f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*400.0f)/* 80% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 0.7f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetCurrentColor().a, 0.7f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), 0.7f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).a, 0.7f, 0.01f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*100.0f)/* 90% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 0.76f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetCurrentColor().a, 0.76f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), 0.76f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).a, 0.76f, 0.01f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*100.0f)+1/* 100% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), startValue, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 0.9f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetCurrentColor().a, 0.9f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), 0.9f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).a, 0.9f, 0.01f, TEST_LOCATION ); // We did expect the animation to finish @@ -8419,14 +9158,18 @@ int UtcDaliAnimationAnimateBetweenActorColorP(void) float startValue(1.0f); Actor actor = Actor::New(); - actor.SetColor(Vector4(startValue, startValue, startValue, startValue)); + actor.SetProperty( Actor::Property::COLOR,Vector4(startValue, startValue, startValue, startValue)); Stage::GetCurrent().Add(actor); - DALI_TEST_EQUALS( actor.GetCurrentColor().a, startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).a, startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -8449,38 +9192,38 @@ int UtcDaliAnimationAnimateBetweenActorColorP(void) application.Render(0); application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), 0.1f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), 0.2f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), 0.3f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 0.4f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), 0.1f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), 0.2f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), 0.3f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), 0.4f, 0.01f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)/* 25% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), 0.5f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), 0.5f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), 0.5f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 0.5f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), 0.5f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), 0.5f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), 0.5f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), 0.5f, 0.01f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)/* 50% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), 0.9f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), 0.8f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), 0.7f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 0.6f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), 0.9f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), 0.8f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), 0.7f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), 0.6f, 0.01f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)/* 75% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), 0.95f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), 0.90f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), 0.85f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 0.80f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), 0.95f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), 0.90f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), 0.85f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), 0.80f, 0.01f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)+1/* 100% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), 1.0f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), 1.0f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), 1.0f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), 1.0f, 0.01f, TEST_LOCATION ); // We did expect the animation to finish @@ -8494,14 +9237,18 @@ int UtcDaliAnimationAnimateBetweenActorColorCubicP(void) float startValue(1.0f); Actor actor = Actor::New(); - actor.SetColor(Vector4(startValue, startValue, startValue, startValue)); + actor.SetProperty( Actor::Property::COLOR,Vector4(startValue, startValue, startValue, startValue)); Stage::GetCurrent().Add(actor); - DALI_TEST_EQUALS( actor.GetCurrentColor().a, startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).a, startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -8524,38 +9271,38 @@ int UtcDaliAnimationAnimateBetweenActorColorCubicP(void) application.Render(0); application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), 0.1f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), 0.2f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), 0.3f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 0.4f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), 0.1f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), 0.2f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), 0.3f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), 0.4f, 0.01f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)/* 25% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), 0.55f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), 0.525f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), 0.506f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 0.4875f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), 0.55f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), 0.525f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), 0.506f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), 0.4875f, 0.01f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)/* 50% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), 0.9f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), 0.8f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), 0.7f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 0.6f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), 0.9f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), 0.8f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), 0.7f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), 0.6f, 0.01f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)/* 75% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), 0.99375f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), 0.925f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), 0.85625f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 0.7875f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), 0.99375f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), 0.925f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), 0.85625f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), 0.7875f, 0.01f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)+1/* 100% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), 1.0f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), 1.0f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), 1.0f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), 1.0f, 0.01f, TEST_LOCATION ); // We did expect the animation to finish @@ -8569,13 +9316,13 @@ int UtcDaliAnimationAnimateBetweenActorVisibleP(void) Actor actor = Actor::New(); AngleAxis aa(Degree(90), Vector3::XAXIS); - actor.SetOrientation(aa.angle, aa.axis); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(aa.angle, aa.axis) ); Stage::GetCurrent().Add(actor); application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( actor.IsVisible(), true, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ), true, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -8593,6 +9340,9 @@ int UtcDaliAnimationAnimateBetweenActorVisibleP(void) // Start the animation animation.Play(); + // Final key frame value should be retrievable straight away + DALI_TEST_EQUALS( actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ), true, TEST_LOCATION ); + bool signalReceived(false); AnimationFinishCheck finishCheck(signalReceived); animation.FinishedSignal().Connect(&application, finishCheck); @@ -8603,7 +9353,7 @@ int UtcDaliAnimationAnimateBetweenActorVisibleP(void) application.Render(static_cast(durationSeconds*500.0f)+1); application.SendNotification(); - DALI_TEST_EQUALS( actor.IsVisible(), true, TEST_LOCATION); + DALI_TEST_EQUALS( actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ), true, TEST_LOCATION); finishCheck.CheckSignalReceived(); END_TEST; } @@ -8614,13 +9364,13 @@ int UtcDaliAnimationAnimateBetweenActorVisibleCubicP(void) Actor actor = Actor::New(); AngleAxis aa(Degree(90), Vector3::XAXIS); - actor.SetOrientation(aa.angle, aa.axis); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(aa.angle, aa.axis) ); Stage::GetCurrent().Add(actor); application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( actor.IsVisible(), true, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ), true, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -8649,7 +9399,7 @@ int UtcDaliAnimationAnimateBetweenActorVisibleCubicP(void) application.Render(static_cast(durationSeconds*500.0f)+1); application.SendNotification(); - DALI_TEST_EQUALS( actor.IsVisible(), true, TEST_LOCATION); + DALI_TEST_EQUALS( actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ), true, TEST_LOCATION); finishCheck.CheckSignalReceived(); END_TEST; } @@ -8660,13 +9410,13 @@ int UtcDaliAnimationAnimateBetweenActorOrientation01P(void) Actor actor = Actor::New(); AngleAxis aa(Degree(90), Vector3::XAXIS); - actor.SetOrientation(aa.angle, aa.axis); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(aa.angle, aa.axis) ); Stage::GetCurrent().Add(actor); application.SendNotification(); application.Render(0); Quaternion start(Radian(aa.angle), aa.axis); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), start, 0.001f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), start, 0.001f, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -8680,6 +9430,9 @@ int UtcDaliAnimationAnimateBetweenActorOrientation01P(void) // Start the animation animation.Play(); + // Final key frame value should be retrievable straight away + DALI_TEST_EQUALS( actor.GetProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Degree( 60 ), Vector3::ZAXIS ), TEST_LOCATION ); + bool signalReceived(false); AnimationFinishCheck finishCheck(signalReceived); animation.FinishedSignal().Connect(&application, finishCheck); @@ -8692,7 +9445,7 @@ int UtcDaliAnimationAnimateBetweenActorOrientation01P(void) Quaternion check( Radian(Degree(60)), Vector3::ZAXIS ); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), check, 0.001f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), check, 0.001f, TEST_LOCATION ); finishCheck.CheckSignalReceived(); END_TEST; } @@ -8703,13 +9456,13 @@ int UtcDaliAnimationAnimateBetweenActorOrientation02P(void) Actor actor = Actor::New(); AngleAxis aa(Degree(90), Vector3::XAXIS); - actor.SetOrientation(aa.angle, aa.axis); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(aa.angle, aa.axis) ); application.SendNotification(); application.Render(0); Stage::GetCurrent().Add(actor); Quaternion start(Radian(aa.angle), aa.axis); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), start, 0.001f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), start, 0.001f, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -8734,27 +9487,27 @@ int UtcDaliAnimationAnimateBetweenActorOrientation02P(void) finishCheck.CheckSignalNotReceived(); Quaternion check(Radian(Degree(60)), Vector3::XAXIS); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), check, 0.001f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), check, 0.001f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)/* 25% progress */); application.SendNotification(); check = Quaternion( Radian(Degree(90)), Vector3::XAXIS ); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), check, 0.001f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), check, 0.001f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)/* 50% progress */); application.SendNotification(); check = Quaternion( Radian(Degree(120)), Vector3::XAXIS ); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), check, 0.001f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), check, 0.001f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)/* 75% progress */); application.SendNotification(); check = Quaternion( Radian(Degree(101.5)), Vector3(0.5f, 0.5f, 0.0f) ); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), check, 0.001f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), check, 0.001f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)+1/* 100% progress */); application.SendNotification(); check = Quaternion( Radian(Degree(120)), Vector3::YAXIS ); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), check, 0.001f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), check, 0.001f, TEST_LOCATION ); // We did expect the animation to finish @@ -8768,13 +9521,13 @@ int UtcDaliAnimationAnimateBetweenActorOrientation01CubicP(void) Actor actor = Actor::New(); AngleAxis aa(Degree(90), Vector3::XAXIS); - actor.SetOrientation(aa.angle, aa.axis); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(aa.angle, aa.axis) ); Stage::GetCurrent().Add(actor); application.SendNotification(); application.Render(0); Quaternion start(Radian(aa.angle), aa.axis); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), start, 0.001f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), start, 0.001f, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -8801,7 +9554,7 @@ int UtcDaliAnimationAnimateBetweenActorOrientation01CubicP(void) Quaternion check( Radian(Degree(60)), Vector3::ZAXIS ); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), check, 0.001f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), check, 0.001f, TEST_LOCATION ); finishCheck.CheckSignalReceived(); END_TEST; } @@ -8812,13 +9565,13 @@ int UtcDaliAnimationAnimateBetweenActorOrientation02CubicP(void) Actor actor = Actor::New(); AngleAxis aa(Degree(90), Vector3::XAXIS); - actor.SetOrientation(aa.angle, aa.axis); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(aa.angle, aa.axis) ); application.SendNotification(); application.Render(0); Stage::GetCurrent().Add(actor); Quaternion start(Radian(aa.angle), aa.axis); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), start, 0.001f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), start, 0.001f, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -8844,27 +9597,27 @@ int UtcDaliAnimationAnimateBetweenActorOrientation02CubicP(void) finishCheck.CheckSignalNotReceived(); Quaternion check(Radian(Degree(60)), Vector3::XAXIS); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), check, 0.001f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), check, 0.001f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)/* 25% progress */); application.SendNotification(); check = Quaternion( Radian(Degree(90)), Vector3::XAXIS ); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), check, 0.001f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), check, 0.001f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)/* 50% progress */); application.SendNotification(); check = Quaternion( Radian(Degree(120)), Vector3::XAXIS ); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), check, 0.001f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), check, 0.001f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)/* 75% progress */); application.SendNotification(); check = Quaternion( Radian(Degree(101.5)), Vector3(0.5f, 0.5f, 0.0f ) ); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), check, 0.001f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), check, 0.001f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)+1/* 100% progress */); application.SendNotification(); check = Quaternion( Radian(Degree(120)), Vector3::YAXIS ); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), check, 0.001f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), check, 0.001f, TEST_LOCATION ); // We did expect the animation to finish @@ -8878,14 +9631,18 @@ int UtcDaliAnimationAnimateBetweenActorColorAlphaFunctionP(void) float startValue(1.0f); Actor actor = Actor::New(); - actor.SetColor(Vector4(startValue, startValue, startValue, startValue)); + actor.SetProperty( Actor::Property::COLOR,Vector4(startValue, startValue, startValue, startValue)); Stage::GetCurrent().Add(actor); - DALI_TEST_EQUALS( actor.GetCurrentColor().a, startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).a, startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -8908,38 +9665,38 @@ int UtcDaliAnimationAnimateBetweenActorColorAlphaFunctionP(void) application.Render(0); application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), 0.1f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), 0.2f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), 0.3f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 0.4f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), 0.1f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), 0.2f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), 0.3f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), 0.4f, 0.01f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)/* 25% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), 0.5f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), 0.5f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), 0.5f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 0.5f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), 0.5f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), 0.5f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), 0.5f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), 0.5f, 0.01f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)/* 50% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), 0.9f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), 0.8f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), 0.7f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 0.6f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), 0.9f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), 0.8f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), 0.7f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), 0.6f, 0.01f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)/* 75% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), 0.95f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), 0.90f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), 0.85f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 0.80f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), 0.95f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), 0.90f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), 0.85f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), 0.80f, 0.01f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)+1/* 100% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), 1.0f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), 1.0f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), 1.0f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), 1.0f, 0.01f, TEST_LOCATION ); // We did expect the animation to finish @@ -8953,14 +9710,18 @@ int UtcDaliAnimationAnimateBetweenActorColorAlphaFunctionCubicP(void) float startValue(1.0f); Actor actor = Actor::New(); - actor.SetColor(Vector4(startValue, startValue, startValue, startValue)); + actor.SetProperty( Actor::Property::COLOR,Vector4(startValue, startValue, startValue, startValue)); Stage::GetCurrent().Add(actor); - DALI_TEST_EQUALS( actor.GetCurrentColor().a, startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).a, startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -8983,38 +9744,38 @@ int UtcDaliAnimationAnimateBetweenActorColorAlphaFunctionCubicP(void) application.Render(0); application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), 0.1f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), 0.2f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), 0.3f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 0.4f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), 0.1f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), 0.2f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), 0.3f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), 0.4f, 0.01f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)/* 25% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), 0.55f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), 0.525f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), 0.506f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 0.4875f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), 0.55f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), 0.525f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), 0.506f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), 0.4875f, 0.01f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)/* 50% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), 0.9f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), 0.8f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), 0.7f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 0.6f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), 0.9f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), 0.8f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), 0.7f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), 0.6f, 0.01f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)/* 75% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), 0.99375f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), 0.925f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), 0.85625f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 0.7875f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), 0.99375f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), 0.925f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), 0.85625f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), 0.7875f, 0.01f, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)+1/* 100% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), 1.0f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), 1.0f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), 1.0f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), 1.0f, 0.01f, TEST_LOCATION ); // We did expect the animation to finish @@ -9028,14 +9789,18 @@ int UtcDaliAnimationAnimateBetweenActorColorTimePeriodP(void) float startValue(1.0f); Actor actor = Actor::New(); - actor.SetColor(Vector4(startValue, startValue, startValue, startValue)); + actor.SetProperty( Actor::Property::COLOR,Vector4(startValue, startValue, startValue, startValue)); Stage::GetCurrent().Add(actor); - DALI_TEST_EQUALS( actor.GetCurrentColor().a, startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).a, startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -9060,38 +9825,38 @@ int UtcDaliAnimationAnimateBetweenActorColorTimePeriodP(void) application.Render(static_cast(delay*1000.0f)/* 0% progress */); application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), 0.1f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), 0.2f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), 0.3f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 0.4f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), 0.1f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), 0.2f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), 0.3f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), 0.4f, 0.01f, TEST_LOCATION ); application.Render(static_cast((durationSeconds - delay)*250.0f)/* 25% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), 0.5f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), 0.5f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), 0.5f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 0.5f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), 0.5f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), 0.5f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), 0.5f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), 0.5f, 0.01f, TEST_LOCATION ); application.Render(static_cast((durationSeconds - delay)*250.0f)/* 50% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), 0.9f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), 0.8f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), 0.7f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 0.6f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), 0.9f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), 0.8f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), 0.7f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), 0.6f, 0.01f, TEST_LOCATION ); application.Render(static_cast((durationSeconds - delay)*250.0f)/* 75% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), 0.95f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), 0.90f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), 0.85f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 0.80f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), 0.95f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), 0.90f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), 0.85f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), 0.80f, 0.01f, TEST_LOCATION ); application.Render(static_cast((durationSeconds - delay)*250.0f)+1/* 100% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), 1.0f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), 1.0f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), 1.0f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), 1.0f, 0.01f, TEST_LOCATION ); // We did expect the animation to finish @@ -9105,14 +9870,18 @@ int UtcDaliAnimationAnimateBetweenActorColorTimePeriodCubicP(void) float startValue(1.0f); Actor actor = Actor::New(); - actor.SetColor(Vector4(startValue, startValue, startValue, startValue)); + actor.SetProperty( Actor::Property::COLOR,Vector4(startValue, startValue, startValue, startValue)); Stage::GetCurrent().Add(actor); - DALI_TEST_EQUALS( actor.GetCurrentColor().a, startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).a, startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -9137,38 +9906,38 @@ int UtcDaliAnimationAnimateBetweenActorColorTimePeriodCubicP(void) application.Render(static_cast(delay*1000.0f)/* 0% progress */); application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), 0.1f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), 0.2f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), 0.3f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 0.4f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), 0.1f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), 0.2f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), 0.3f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), 0.4f, 0.01f, TEST_LOCATION ); application.Render(static_cast((durationSeconds - delay)*250.0f)/* 25% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), 0.55f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), 0.525f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), 0.506f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 0.4875f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), 0.55f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), 0.525f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), 0.506f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), 0.4875f, 0.01f, TEST_LOCATION ); application.Render(static_cast((durationSeconds - delay)*250.0f)/* 50% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), 0.9f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), 0.8f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), 0.7f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 0.6f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), 0.9f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN), 0.8f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), 0.7f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), 0.6f, 0.01f, TEST_LOCATION ); application.Render(static_cast((durationSeconds - delay)*250.0f)/* 75% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), 0.99375f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), 0.925f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), 0.85625f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 0.7875f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), 0.99375f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), 0.925f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), 0.85625f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), 0.7875f, 0.01f, TEST_LOCATION ); application.Render(static_cast((durationSeconds - delay)*250.0f)+1/* 100% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), 1.0f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), 1.0f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), 1.0f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), 1.0f, 0.01f, TEST_LOCATION ); // We did expect the animation to finish @@ -9183,14 +9952,18 @@ int UtcDaliAnimationAnimateBetweenActorColorAlphaFunctionTimePeriodP(void) float startValue(1.0f); float delay = 0.5f; Actor actor = Actor::New(); - actor.SetColor(Vector4(startValue, startValue, startValue, startValue)); + actor.SetProperty( Actor::Property::COLOR,Vector4(startValue, startValue, startValue, startValue)); Stage::GetCurrent().Add(actor); - DALI_TEST_EQUALS( actor.GetCurrentColor().a, startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).a, startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -9214,38 +9987,38 @@ int UtcDaliAnimationAnimateBetweenActorColorAlphaFunctionTimePeriodP(void) application.Render(static_cast(delay*1000.0f)/* 0% progress */); application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), 0.1f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), 0.2f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), 0.3f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 0.4f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), 0.1f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), 0.2f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), 0.3f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), 0.4f, 0.01f, TEST_LOCATION ); application.Render(static_cast((durationSeconds - delay)*250.0f)/* 25% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), 0.5f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), 0.5f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), 0.5f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 0.5f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), 0.5f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), 0.5f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), 0.5f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), 0.5f, 0.01f, TEST_LOCATION ); application.Render(static_cast((durationSeconds - delay)*250.0f)/* 50% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), 0.9f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), 0.8f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), 0.7f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 0.6f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), 0.9f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), 0.8f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), 0.7f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), 0.6f, 0.01f, TEST_LOCATION ); application.Render(static_cast((durationSeconds - delay)*250.0f)/* 75% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), 0.95f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), 0.90f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), 0.85f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 0.80f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), 0.95f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), 0.90f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), 0.85f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), 0.80f, 0.01f, TEST_LOCATION ); application.Render(static_cast((durationSeconds - delay)*250.0f)+1/* 100% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), 1.0f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), 1.0f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), 1.0f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), 1.0f, 0.01f, TEST_LOCATION ); // We did expect the animation to finish @@ -9259,14 +10032,19 @@ int UtcDaliAnimationAnimateBetweenActorColorCubicWithDelayP(void) float startValue(1.0f); Actor actor = Actor::New(); - actor.SetColor(Vector4(startValue, startValue, startValue, startValue)); + actor.SetProperty( Actor::Property::COLOR,Vector4(startValue, startValue, startValue, startValue)); Stage::GetCurrent().Add(actor); - DALI_TEST_EQUALS( actor.GetCurrentColor().a, startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).a, startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), startValue, TEST_LOCATION ); DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), startValue, TEST_LOCATION ); + // Build the animation float durationSeconds(1.0f); @@ -9291,38 +10069,38 @@ int UtcDaliAnimationAnimateBetweenActorColorCubicWithDelayP(void) application.Render(static_cast(delay*1000.0f)/* 0% progress */); application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), 0.1f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), 0.2f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), 0.3f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 0.4f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), 0.1f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), 0.2f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), 0.3f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), 0.4f, 0.01f, TEST_LOCATION ); application.Render(static_cast((durationSeconds - delay)*250.0f)/* 25% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), 0.55f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), 0.525f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), 0.506f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 0.4875f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), 0.55f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), 0.525f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), 0.506f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), 0.4875f, 0.01f, TEST_LOCATION ); application.Render(static_cast((durationSeconds - delay)*250.0f)/* 50% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), 0.9f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), 0.8f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), 0.7f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 0.6f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), 0.9f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), 0.8f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), 0.7f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), 0.6f, 0.01f, TEST_LOCATION ); application.Render(static_cast((durationSeconds - delay)*250.0f)/* 75% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), 0.99375f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), 0.925f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), 0.85625f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 0.7875f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), 0.99375f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), 0.925f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), 0.85625f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), 0.7875f, 0.01f, TEST_LOCATION ); application.Render(static_cast((durationSeconds - delay)*250.0f)+1/* 100% progress */); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), 1.0f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_GREEN), 1.0f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_BLUE), 1.0f, 0.01f, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_ALPHA), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), 1.0f, 0.01f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), 1.0f, 0.01f, TEST_LOCATION ); // We did expect the animation to finish @@ -9374,36 +10152,36 @@ int UtcDaliAnimationAnimateP(void) Quaternion rotation; path.Sample( 0.0f, position, tangent ); rotation = Quaternion( Vector3::XAXIS, tangent ); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), position, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), rotation, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), position, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), rotation, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)/* 25% progress */); application.SendNotification(); path.Sample( 0.25f, position, tangent ); rotation = Quaternion( Vector3::XAXIS, tangent ); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), position, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), rotation, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), position, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), rotation, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)/* 50% progress */); application.SendNotification(); path.Sample( 0.5f, position, tangent ); rotation = Quaternion( Vector3::XAXIS, tangent ); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), position, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), rotation, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), position, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), rotation, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)/* 75% progress */); application.SendNotification(); path.Sample( 0.75f, position, tangent ); rotation = Quaternion( Vector3::XAXIS, tangent ); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), position, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), rotation, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), position, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), rotation, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)+1/* 100% progress */); application.SendNotification(); path.Sample( 1.0f, position, tangent ); rotation = Quaternion( Vector3::XAXIS, tangent ); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), position, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), rotation, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), position, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), rotation, TEST_LOCATION ); finishCheck.CheckSignalReceived(); END_TEST; @@ -9453,36 +10231,36 @@ int UtcDaliAnimationAnimateAlphaFunctionP(void) Quaternion rotation; path.Sample( 0.0f, position, tangent ); rotation = Quaternion( Vector3::XAXIS, tangent ); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), position, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), rotation, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), position, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), rotation, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)/* 25% progress */); application.SendNotification(); path.Sample( 0.25f, position, tangent ); rotation = Quaternion( Vector3::XAXIS, tangent ); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), position, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), rotation, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), position, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), rotation, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)/* 50% progress */); application.SendNotification(); path.Sample( 0.5f, position, tangent ); rotation = Quaternion( Vector3::XAXIS, tangent ); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), position, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), rotation, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), position, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), rotation, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)/* 75% progress */); application.SendNotification(); path.Sample( 0.75f, position, tangent ); rotation = Quaternion( Vector3::XAXIS, tangent ); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), position, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), rotation, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), position, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), rotation, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)+1/* 100% progress */); application.SendNotification(); path.Sample( 1.0f, position, tangent ); rotation = Quaternion( Vector3::XAXIS, tangent ); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), position, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), rotation, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), position, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), rotation, TEST_LOCATION ); finishCheck.CheckSignalReceived(); END_TEST; @@ -9532,36 +10310,36 @@ int UtcDaliAnimationAnimateTimePeriodP(void) Quaternion rotation; path.Sample( 0.0f, position, tangent ); rotation = Quaternion( Vector3::XAXIS, tangent ); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), position, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), rotation, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), position, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), rotation, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)/* 25% progress */); application.SendNotification(); path.Sample( 0.25f, position, tangent ); rotation = Quaternion( Vector3::XAXIS, tangent ); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), position, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), rotation, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), position, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), rotation, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)/* 50% progress */); application.SendNotification(); path.Sample( 0.5f, position, tangent ); rotation = Quaternion( Vector3::XAXIS, tangent ); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), position, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), rotation, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), position, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), rotation, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)/* 75% progress */); application.SendNotification(); path.Sample( 0.75f, position, tangent ); rotation = Quaternion( Vector3::XAXIS, tangent ); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), position, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), rotation, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), position, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), rotation, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)+1/* 100% progress */); application.SendNotification(); path.Sample( 1.0f, position, tangent ); rotation = Quaternion( Vector3::XAXIS, tangent ); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), position, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), rotation, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), position, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), rotation, TEST_LOCATION ); finishCheck.CheckSignalReceived(); END_TEST; @@ -9611,36 +10389,36 @@ int UtcDaliAnimationAnimateAlphaFunctionTimePeriodP(void) Quaternion rotation; path.Sample( 0.0f, position, tangent ); rotation = Quaternion( Vector3::XAXIS, tangent ); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), position, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), rotation, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), position, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), rotation, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)/* 25% progress */); application.SendNotification(); path.Sample( 0.25f, position, tangent ); rotation = Quaternion( Vector3::XAXIS, tangent ); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), position, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), rotation, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), position, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), rotation, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)/* 50% progress */); application.SendNotification(); path.Sample( 0.5f, position, tangent ); rotation = Quaternion( Vector3::XAXIS, tangent ); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), position, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), rotation, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), position, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), rotation, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)/* 75% progress */); application.SendNotification(); path.Sample( 0.75f, position, tangent ); rotation = Quaternion( Vector3::XAXIS, tangent ); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), position, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), rotation, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), position, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), rotation, TEST_LOCATION ); application.Render(static_cast(durationSeconds*250.0f)+1/* 100% progress */); application.SendNotification(); path.Sample( 1.0f, position, tangent ); rotation = Quaternion( Vector3::XAXIS, tangent ); - DALI_TEST_EQUALS( actor.GetCurrentPosition(), position, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetCurrentOrientation(), rotation, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), position, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), rotation, TEST_LOCATION ); finishCheck.CheckSignalReceived(); END_TEST; @@ -9651,10 +10429,10 @@ int UtcDaliAnimationShowP(void) TestApplication application; Actor actor = Actor::New(); - actor.SetVisible(false); + actor.SetProperty( Actor::Property::VISIBLE,false); application.SendNotification(); application.Render(0); - DALI_TEST_CHECK( !actor.IsVisible() ); + DALI_TEST_CHECK( !actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) ); Stage::GetCurrent().Add(actor); // Start the animation @@ -9673,7 +10451,7 @@ int UtcDaliAnimationShowP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_CHECK( !actor.IsVisible() ); + DALI_TEST_CHECK( !actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) ); application.SendNotification(); application.Render(static_cast(durationSeconds*10.0f)/*Should be shown now*/); @@ -9681,7 +10459,7 @@ int UtcDaliAnimationShowP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_CHECK( actor.IsVisible() ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) ); application.SendNotification(); application.Render(static_cast(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/); @@ -9689,7 +10467,7 @@ int UtcDaliAnimationShowP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_CHECK( actor.IsVisible() ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) ); END_TEST; } @@ -9698,7 +10476,7 @@ int UtcDaliAnimationHideP(void) TestApplication application; Actor actor = Actor::New(); - DALI_TEST_CHECK( actor.IsVisible() ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) ); Stage::GetCurrent().Add(actor); // Start the animation @@ -9717,7 +10495,7 @@ int UtcDaliAnimationHideP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_CHECK( actor.IsVisible() ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) ); application.SendNotification(); application.Render(static_cast(durationSeconds*10.0f)/*Should be hidden now*/); @@ -9725,7 +10503,7 @@ int UtcDaliAnimationHideP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_CHECK( !actor.IsVisible() ); + DALI_TEST_CHECK( !actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) ); application.SendNotification(); application.Render(static_cast(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/); @@ -9733,7 +10511,7 @@ int UtcDaliAnimationHideP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_CHECK( !actor.IsVisible() ); + DALI_TEST_CHECK( !actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) ); END_TEST; } @@ -9745,7 +10523,7 @@ int UtcDaliAnimationShowHideAtEndP(void) TestApplication application; Actor actor = Actor::New(); - DALI_TEST_CHECK( actor.IsVisible() ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) ); Stage::GetCurrent().Add(actor); // Start Hide animation @@ -9764,7 +10542,7 @@ int UtcDaliAnimationShowHideAtEndP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_CHECK( !actor.IsVisible() ); + DALI_TEST_CHECK( !actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) ); // Start Show animation animation = Animation::New(durationSeconds); @@ -9778,7 +10556,7 @@ int UtcDaliAnimationShowHideAtEndP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_CHECK( actor.IsVisible() ); + DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) ); END_TEST; } @@ -9860,6 +10638,7 @@ int UtcDaliAnimationUpdateManagerP(void) // Apply animation to actor animation.AnimateTo( Property(actor, Actor::Property::POSITION), Vector3( 100.f, 90.f, 80.f ), AlphaFunction::LINEAR ); + animation.AnimateTo( Property(actor, DevelActor::Property::OPACITY), 0.3f, AlphaFunction::LINEAR ); animation.Play(); @@ -9939,6 +10718,7 @@ int UtcDaliAnimationExtendDurationP(void) Property::Index index = actor.RegisterProperty( "testProperty", startValue ); Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( index ), startValue, TEST_LOCATION ); // Build the animation float initialDurationSeconds(1.0f); @@ -9966,10 +10746,11 @@ int UtcDaliAnimationExtendDurationP(void) application.SendNotification(); application.Render(static_cast(extendedDurationSeconds*500.0f)/* 50% animation progress, 0% animator progress */); - // We didn't expect the animation to finish yet + // We didn't expect the animation to finish yet, but cached value should be the final one application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( index ), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( index ), startValue, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(extendedDurationSeconds*250.0f)/* 75% animation progress, 50% animator progress */); @@ -9977,7 +10758,7 @@ int UtcDaliAnimationExtendDurationP(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), startValue+(relativeValue*0.5f), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( index ), startValue+(relativeValue*0.5f), TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(extendedDurationSeconds*250.0f) + 1u/*just beyond the animation duration*/); @@ -9985,7 +10766,8 @@ int UtcDaliAnimationExtendDurationP(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( index ), targetValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( index ), targetValue, TEST_LOCATION ); END_TEST; } @@ -9998,7 +10780,8 @@ int UtcDaliAnimationCustomIntProperty(void) int startValue(0u); Property::Index index = actor.RegisterProperty("anIndex", startValue); - DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< int >( index ), startValue, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< int >( index ), startValue, TEST_LOCATION ); // Build the animation float durationSeconds(1.0f); @@ -10008,6 +10791,9 @@ int UtcDaliAnimationCustomIntProperty(void) // Start the animation animation.Play(); + // Target value should be retrievable straight away + DALI_TEST_EQUALS( actor.GetProperty< int >( index ), 20, TEST_LOCATION ); + bool signalReceived(false); AnimationFinishCheck finishCheck(signalReceived); animation.FinishedSignal().Connect(&application, finishCheck); @@ -10018,7 +10804,7 @@ int UtcDaliAnimationCustomIntProperty(void) // We didn't expect the animation to finish yet application.SendNotification(); finishCheck.CheckSignalNotReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), 10, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< int >( index ), 10, TEST_LOCATION ); application.SendNotification(); application.Render(static_cast(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/); @@ -10026,7 +10812,8 @@ int UtcDaliAnimationCustomIntProperty(void) // We did expect the animation to finish application.SendNotification(); finishCheck.CheckSignalReceived(); - DALI_TEST_EQUALS( actor.GetProperty(index), 20, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< int >( index ), 20, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< int >( index ), 20, TEST_LOCATION ); END_TEST; } @@ -10063,19 +10850,14 @@ int UtcDaliAnimationAnimateByNonAnimateableTypeN(void) Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); - try + DALI_TEST_ASSERTION( { // Build the animation Animation animation = Animation::New( 2.0f ); std::string relativeValue = "relative string"; animation.AnimateBy( Property(actor, index), relativeValue ); tet_result(TET_FAIL); - } - catch ( Dali::DaliException& e ) - { - DALI_TEST_ASSERT( e, "Animated value and Property type don't match", TEST_LOCATION ); - } - + }, "Target value is not animatable" ); END_TEST; } @@ -10093,19 +10875,13 @@ int UtcDaliAnimationAnimateToNonAnimateableTypeN(void) Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); - try + DALI_TEST_ASSERTION( { // Build the animation Animation animation = Animation::New( 2.0f ); std::string relativeValue = "relative string"; animation.AnimateTo( Property(actor, index), relativeValue ); - - tet_result(TET_FAIL); - } - catch ( Dali::DaliException& e ) - { - DALI_TEST_ASSERT( e, "Animated value and Property type don't match", TEST_LOCATION ); - } + }, "Target value is not animatable" ); END_TEST; } @@ -10122,20 +10898,2672 @@ int UtcDaliAnimationAnimateBetweenNonAnimateableTypeN(void) Stage::GetCurrent().Add(actor); DALI_TEST_EQUALS( actor.GetProperty(index), startValue, TEST_LOCATION ); - try + DALI_TEST_ASSERTION( { // Build the animation KeyFrames keyFrames = KeyFrames::New(); keyFrames.Add( 0.0f, std::string("relative string1") ); keyFrames.Add( 1.0f, std::string("relative string2") ); // no need to really create the animation as keyframes do the check + }, "Property type is not animatable" ); - tet_result(TET_FAIL); - } - catch ( Dali::DaliException& e ) + END_TEST; +} + +int UtcDaliAnimationSetAndGetTargetBeforePlayP(void) +{ + tet_infoline("Setting up an animation should not effect it's position property until the animation plays"); + + TestApplication application; + + tet_infoline("Set initial position and set up animation to re-position actor"); + + Actor actor = Actor::New(); + Stage::GetCurrent().Add(actor); + Vector3 initialPosition(0.0f, 0.0f, 0.0f); + actor.SetProperty( Actor::Property::POSITION, initialPosition ); + + // Build the animation + Animation animation = Animation::New(2.0f); + + //Test GetCurrentProgress return 0.0 as the duration is 0.0 + DALI_TEST_EQUALS( 0.0f, animation.GetCurrentProgress(), TEST_LOCATION ); + DALI_TEST_EQUALS( Vector3( 0.0f, 0.0f, 0.0f ), actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); + + tet_infoline("Set target position in animation without intiating play"); + + Vector3 targetPosition(100.0f, 100.0f, 100.0f); + animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR); + + application.SendNotification(); + application.Render(); + + tet_infoline("Ensure position of actor is still at intial value"); + + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_X), initialPosition.x, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_Y), initialPosition.y, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_Z), initialPosition.z, TEST_LOCATION ); + + tet_infoline("Play animation and ensure actor position is now target"); + + animation.Play(); + application.SendNotification(); + application.Render(1000u); + + tet_infoline("Ensure position of actor is at target value when aninmation half way"); + + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_X), targetPosition.x, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_Y), targetPosition.y, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_Z), targetPosition.z, TEST_LOCATION ); + + tet_printf( "x position at half way point(%f)\n", actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ).x ); + + application.Render(2000u); + + tet_infoline("Ensure position of actor is still at target value when aninmation complete"); + + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_X), targetPosition.x, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_Y), targetPosition.y, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_Z), targetPosition.z, TEST_LOCATION ); + + END_TEST; +} + +int UtcDaliAnimationSetAndGetTargetBeforePlayMulitpleAnimatorsPositionP(void) +{ + tet_infoline("Setting up an animation should not effect it's position property until the animation plays even with mulitple animators"); + + TestApplication application; + + std::vector targetPositions; + + targetPositions.push_back( Vector3( 100.0f, 100.0f, 100.0f ) ); + targetPositions.push_back( Vector3( 200.0f, 1.0f, 100.0f ) ); + targetPositions.push_back( Vector3( 50.0f, 10.0f, 100.0f ) ); + + tet_infoline("Set initial position and set up animation to re-position actor"); + + Actor actor = Actor::New(); + Stage::GetCurrent().Add(actor); + Vector3 initialPosition(0.0f, 0.0f, 0.0f); + actor.SetProperty( Actor::Property::POSITION, initialPosition ); + + // Build the animation + Animation animation = Animation::New(2.0f); + + //Test GetCurrentProgress return 0.0 as the duration is 0.0 + DALI_TEST_EQUALS( 0.0f, animation.GetCurrentProgress(), TEST_LOCATION ); + DALI_TEST_EQUALS( Vector3( 0.0f, 0.0f, 0.0f ), actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); + + tet_infoline("Set target position in animation without intiating play"); + + for ( unsigned int i = 0; i < targetPositions.size(); i++ ) { - DALI_TEST_ASSERT( e, "Type not animateable", TEST_LOCATION ); + animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPositions[i], AlphaFunction::LINEAR); } + application.SendNotification(); + application.Render(); + + tet_infoline("Ensure position of actor is still at intial value"); + + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_X), initialPosition.x, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_Y), initialPosition.y, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_Z), initialPosition.z, TEST_LOCATION ); + + tet_infoline("Play animation and ensure actor position is now target"); + + animation.Play(); + application.SendNotification(); + application.Render(1000u); + + tet_infoline("Ensure position of actor is at target value when aninmation half way"); + + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_X), targetPositions[2].x, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_Y), targetPositions[2].y, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_Z), targetPositions[2].z, TEST_LOCATION ); + + tet_printf( "x position at half way point(%f)\n", actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ).x ); + + application.Render(2000u); + + tet_infoline("Ensure position of actor is still at target value when aninmation complete"); + + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_X), targetPositions[2].x, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_Y), targetPositions[2].y, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_Z), targetPositions[2].z, TEST_LOCATION ); + + END_TEST; +} + +int UtcDaliAnimationSetAndGetTargetBeforePlayMulitpleAnimatorsSizeAndPositionP(void) +{ + tet_infoline("Setting up an animation should not effect it's size property until the animation plays even with mulitple animators of different Property Indexes"); + + TestApplication application; + + std::vector targetSizes; + std::vector targetPositions; + + targetSizes.push_back( Vector3( 100.0f, 100.0f, 100.0f ) ); + targetSizes.push_back( Vector3( 50.0f, 10.0f, 100.0f ) ); + + targetPositions.push_back( Vector3( 200.0f, 1.0f, 100.0f ) ); + + tet_infoline("Set initial position and set up animation to re-position actor"); + + Actor actor = Actor::New(); + Stage::GetCurrent().Add(actor); + Vector3 initialSize( 10.0f, 10.0f, 10.0f); + Vector3 initialPosition(10.0f, 10.0f, 10.0f); + + actor.SetProperty( Actor::Property::SIZE, initialSize ); + actor.SetProperty( Actor::Property::POSITION, initialPosition ); + + // Build the animation + Animation animation = Animation::New(2.0f); + + tet_infoline("Set target size in animation without intiating play"); + animation.AnimateTo(Property(actor, Actor::Property::SIZE), targetSizes[0], AlphaFunction::LINEAR); + tet_infoline("Set target position in animation without intiating play"); + animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPositions[0], AlphaFunction::LINEAR); + animation.AnimateTo(Property(actor, Actor::Property::SIZE), targetSizes[1], AlphaFunction::LINEAR); + + application.SendNotification(); + application.Render(); + + tet_infoline("Ensure position of actor is still at intial size and position"); + + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SIZE_WIDTH), initialSize.x, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SIZE_HEIGHT), initialSize.y, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SIZE_DEPTH), initialSize.z, TEST_LOCATION ); + + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SIZE_WIDTH), initialPosition.x, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SIZE_HEIGHT), initialPosition.y, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SIZE_DEPTH), initialPosition.z, TEST_LOCATION ); + + tet_infoline("Play animation and ensure actor position and size is now matches targets"); + + animation.Play(); + application.SendNotification(); + application.Render(2000u); + + tet_infoline("Ensure position and size of actor is at target value when aninmation playing"); + + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SIZE_WIDTH), targetSizes[1].x, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SIZE_HEIGHT), targetSizes[1].y, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SIZE_DEPTH), targetSizes[1].z, TEST_LOCATION ); + + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_X), targetPositions[0].x, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_Y), targetPositions[0].y, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_Z), targetPositions[0].z, TEST_LOCATION ); + + END_TEST; +} + +int UtcDaliAnimationSetAndGetTargetBeforePlayMulitpleAnimatorsSizeAndPositionColourP(void) +{ + tet_infoline("Setting up an animation should not effect it's size property until the animation plays even if other Properties animated"); + + TestApplication application; + + std::vector targetSizes; + std::vector targetColors; + + targetSizes.push_back( Vector3( 100.0f, 100.0f, 100.0f ) ); + targetSizes.push_back( Vector3( 50.0f, 10.0f, 150.0f ) ); + + targetColors.push_back( 1.0f ); + + tet_infoline("Set initial position and set up animation to re-position actor"); + + Actor actor = Actor::New(); + Stage::GetCurrent().Add(actor); + Vector3 initialSize( 10.0f, 5.0f, 10.0f); + + actor.SetProperty( Actor::Property::SIZE, initialSize ); + + // Build the animation + Animation animation = Animation::New(2.0f); + + tet_infoline("Set target size in animation without initiating play"); + animation.AnimateTo(Property(actor, Actor::Property::SIZE), targetSizes[0], AlphaFunction::LINEAR); + tet_infoline("Set target position in animation without intiating play"); + animation.AnimateTo(Property(actor, Actor::Property::COLOR_RED), targetColors[0], AlphaFunction::LINEAR); + animation.AnimateTo(Property(actor, Actor::Property::SIZE), targetSizes[1], AlphaFunction::LINEAR); + + application.SendNotification(); + application.Render(); + + tet_infoline("Ensure position of actor is still at initial size and position"); + + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SIZE_WIDTH), initialSize.x, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SIZE_HEIGHT), initialSize.y, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SIZE_DEPTH), initialSize.z, TEST_LOCATION ); + + tet_infoline("Play animation and ensure actor position and size is now matches targets"); + + animation.Play(); + application.SendNotification(); + application.Render(2000u); + + tet_infoline("Ensure position and size of actor is at target value when animation playing"); + + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SIZE_WIDTH), targetSizes[1].x, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SIZE_HEIGHT), targetSizes[1].y, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SIZE_DEPTH), targetSizes[1].z, TEST_LOCATION ); + + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), targetColors[0], TEST_LOCATION ); + + END_TEST; +} + +int UtcDaliAnimationTimePeriodOrder(void) +{ + tet_infoline("Animate the same property with different time periods and ensure it runs correctly and ends up in the right place" ); + + TestApplication application; + + Actor actor = Actor::New(); + Stage::GetCurrent().Add( actor ); + + application.SendNotification(); + application.Render(); + + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_X ), 0.0f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::POSITION_X ), 0.0f, TEST_LOCATION ); + + ////////////////////////////////////////////////////////////////////////////////// + + tet_infoline( "With two AnimateTo calls" ); + + Animation animation = Animation::New( 0.0f ); + animation.AnimateTo( Property( actor, Actor::Property::POSITION_X ), 100.0f, TimePeriod( 3.0f, 1.0f ) ); + animation.AnimateTo( Property( actor, Actor::Property::POSITION_X ), 10.0f, TimePeriod( 1.0f, 1.0f ) ); + animation.Play(); + + tet_infoline( "The target position should change instantly" ); + DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), Vector3( 100.0f, 0.0f, 0.0f ), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_X ), 100.0f, TEST_LOCATION ); + + application.SendNotification(); + application.Render(5000); // After the animation is complete + + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3( 100.0f, 0.0f, 0.0f ), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3( 100.0f, 0.0f, 0.0f ), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::POSITION_X ), 100.0f, TEST_LOCATION ); + + ////////////////////////////////////////////////////////////////////////////////// + + tet_infoline( "Same animation again but in a different order - should yield the same result" ); + + actor.SetX( 0.0f ); + DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_X ), 0.0f, TEST_LOCATION ); + + application.SendNotification(); + application.Render(); + + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::POSITION_X ), 0.0f, TEST_LOCATION ); + + animation = Animation::New( 0.0f ); + animation.AnimateTo( Property( actor, Actor::Property::POSITION_X ), 10.0f, TimePeriod( 1.0f, 1.0f ) ); + animation.AnimateTo( Property( actor, Actor::Property::POSITION_X ), 100.0f, TimePeriod( 3.0f, 1.0f ) ); + animation.Play(); + + tet_infoline( "The target position should change instantly" ); + DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), Vector3( 100.0f, 0.0f, 0.0f ), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_X ), 100.0f, TEST_LOCATION ); + + application.SendNotification(); + application.Render(5000); // After the animation is complete + + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3( 100.0f, 0.0f, 0.0f ), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3( 100.0f, 0.0f, 0.0f ), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::POSITION_X ), 100.0f, TEST_LOCATION ); + + END_TEST; +} + +int UtcDaliAnimationTimePeriodOrderSeveralAnimateToCalls(void) +{ + tet_infoline("Animate the same property with different time periods and ensure it runs correctly and ends up in the right place with several AnimateTo calls" ); + + TestApplication application; + + Actor actor = Actor::New(); + Stage::GetCurrent().Add( actor ); + + application.SendNotification(); + application.Render(); + + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_X ), 0.0f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::POSITION_X ), 0.0f, TEST_LOCATION ); + + ////////////////////////////////////////////////////////////////////////////////// + + tet_infoline( "" ); + + Animation animation = Animation::New( 0.0f ); + animation.AnimateTo( Property( actor, Actor::Property::POSITION_X ), 1000.0f, TimePeriod( 4.0f, 2.0f ) ); + animation.AnimateTo( Property( actor, Actor::Property::POSITION_X ), 145.0f, TimePeriod( 3.0f, 10.0f ) ); + animation.AnimateTo( Property( actor, Actor::Property::POSITION_X ), 109.0f, TimePeriod( 1.0f, 1.0f ) ); + animation.AnimateTo( Property( actor, Actor::Property::POSITION_X ), 1.0f, TimePeriod( 3.0f, 4.0f ) ); + animation.AnimateTo( Property( actor, Actor::Property::POSITION_X ), 200.0f, TimePeriod( 2.0f, 5.0f ) ); + animation.AnimateTo( Property( actor, Actor::Property::POSITION_X ), 10.0f, TimePeriod( 10.0f, 2.0f ) ); + animation.Play(); + + tet_infoline( "The target position should change instantly" ); + DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), Vector3( 145.0f, 0.0f, 0.0f ), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_X ), 145.0f, TEST_LOCATION ); + + application.SendNotification(); + application.Render(14000); // After the animation is complete + + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3( 145.0f, 0.0f, 0.0f ), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3( 145.0f, 0.0f, 0.0f ), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::POSITION_X ), 145.0f, TEST_LOCATION ); + + ////////////////////////////////////////////////////////////////////////////////// + + tet_infoline( "Same animation again but in a different order - should end up at the same point" ); + + actor.SetX( 0.0f ); + + DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_X ), 0.0f, TEST_LOCATION ); + + application.SendNotification(); + application.Render(); + + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::POSITION_X ), 0.0f, TEST_LOCATION ); + + animation = Animation::New( 0.0f ); + animation.AnimateTo( Property( actor, Actor::Property::POSITION_X ), 200.0f, TimePeriod( 2.0f, 5.0f ) ); + animation.AnimateTo( Property( actor, Actor::Property::POSITION_X ), 10.0f, TimePeriod( 10.0f, 2.0f ) ); + animation.AnimateTo( Property( actor, Actor::Property::POSITION_X ), 145.0f, TimePeriod( 3.0f, 10.0f ) ); + animation.AnimateTo( Property( actor, Actor::Property::POSITION_X ), 1000.0f, TimePeriod( 4.0f, 2.0f ) ); + animation.AnimateTo( Property( actor, Actor::Property::POSITION_X ), 1.0f, TimePeriod( 3.0f, 4.0f ) ); + animation.AnimateTo( Property( actor, Actor::Property::POSITION_X ), 109.0f, TimePeriod( 1.0f, 1.0f ) ); + animation.Play(); + + tet_infoline( "The target position should change instantly" ); + DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), Vector3( 145.0f, 0.0f, 0.0f ), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_X ), 145.0f, TEST_LOCATION ); + + application.SendNotification(); + application.Render(14000); // After the animation is complete + + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3( 145.0f, 0.0f, 0.0f ), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3( 145.0f, 0.0f, 0.0f ), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( Actor::Property::POSITION_X ), 145.0f, TEST_LOCATION ); + + END_TEST; +} + +int UtcDaliAnimationAnimateBetweenIntegerP(void) +{ + TestApplication application; + + int startValue(1); + Actor actor = Actor::New(); + const Property::Index index = actor.RegisterProperty("customProperty", startValue ); + Stage::GetCurrent().Add(actor); + + application.Render(); + application.SendNotification(); + + DALI_TEST_EQUALS( actor.GetProperty< int >( index ), startValue, TEST_LOCATION ); + + // Build the animation + float durationSeconds(1.0f); + Animation animation = Animation::New(durationSeconds); + + KeyFrames keyFrames = KeyFrames::New(); + keyFrames.Add(0.0f, 10); + keyFrames.Add(0.2f, 20); + keyFrames.Add(0.4f, 30); + keyFrames.Add(0.6f, 40); + keyFrames.Add(0.8f, 50); + keyFrames.Add(1.0f, 60); + + animation.AnimateBetween( Property(actor, index ), keyFrames ); + + // Start the animation + animation.Play(); + + // Target value should change to the last key-frame's value straight away + DALI_TEST_EQUALS( actor.GetProperty< int >( index ), 60, TEST_LOCATION ); + + END_TEST; +} + +int UtcDaliAnimationAnimateBetweenVector2P(void) +{ + TestApplication application; + + Vector2 startValue( 10.0f, 20.0f ); + Actor actor = Actor::New(); + const Property::Index index = actor.RegisterProperty("customProperty", startValue ); + Stage::GetCurrent().Add(actor); + + application.Render(); + application.SendNotification(); + + DALI_TEST_EQUALS( actor.GetProperty< Vector2 >( index ), startValue, TEST_LOCATION ); + + // Build the animation + float durationSeconds(1.0f); + Animation animation = Animation::New(durationSeconds); + + KeyFrames keyFrames = KeyFrames::New(); + keyFrames.Add( 0.0f, Vector2( 0.0f, 5.0f ) ); + keyFrames.Add( 0.2f, Vector2( 30.0f, 25.0f ) ); + keyFrames.Add( 0.4f, Vector2( 40.0f, 35.0f ) ); + keyFrames.Add( 0.6f, Vector2( 50.0f, 45.0f ) ); + keyFrames.Add( 0.8f, Vector2( 60.0f, 55.0f ) ); + keyFrames.Add( 1.0f, Vector2( 70.0f, 65.0f ) ); + + animation.AnimateBetween( Property(actor, index ), keyFrames ); + + // Start the animation + animation.Play(); + + // Target value should change to the last key-frame's value straight away + DALI_TEST_EQUALS( actor.GetProperty< Vector2 >( index ), Vector2( 70.0f, 65.0f ), TEST_LOCATION ); + + END_TEST; +} + +int UtcDaliAnimationProgressCallbackP(void) +{ + TestApplication application; + + Actor actor = Actor::New(); + Stage::GetCurrent().Add(actor); + + // Build the animation + Animation animation = Animation::New(0.0f); + + //Set duration + float durationSeconds(1.0f); + animation.SetDuration(durationSeconds); + + bool finishedSignalReceived(false); + bool progressSignalReceived(false); + + AnimationFinishCheck finishCheck(finishedSignalReceived); + animation.FinishedSignal().Connect(&application, finishCheck); + + AnimationProgressCheck progressCheck(progressSignalReceived); + DevelAnimation::ProgressReachedSignal( animation ).Connect( &application, progressCheck); + application.SendNotification(); + + Vector3 targetPosition(100.0f, 100.0f, 100.0f); + animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR); + + tet_infoline( "Animation Progress notification set to 30%" ); + DevelAnimation::SetProgressNotification( animation, 0.3f ); + + application.SendNotification(); + application.Render( ); + + DALI_TEST_EQUALS( 0.3f, DevelAnimation::GetProgressNotification( animation ), TEST_LOCATION ); + + progressCheck.CheckSignalNotReceived(); + + // Start the animation from 10% progress + animation.SetCurrentProgress( 0.1f ); + animation.Play(); + + tet_infoline( "Animation Playing from 10%" ); + + application.SendNotification(); + application.Render(0); // start animation + application.Render(durationSeconds*100.0f ); // 20% progress + + tet_infoline( "Animation at 20%" ); + + progressCheck.CheckSignalNotReceived(); + + application.SendNotification(); + application.Render(durationSeconds*200.0f ); // 40% progress + application.SendNotification(); + tet_infoline( "Animation at 40%" ); + DALI_TEST_EQUALS( 0.4f, animation.GetCurrentProgress(), TEST_LOCATION ); + + progressCheck.CheckSignalReceived(); + + tet_infoline( "Progress check reset" ); + progressCheck.Reset(); + + application.Render(durationSeconds*100.0f ); // 50% progress + tet_infoline( "Animation at 50%" ); + application.SendNotification(); + + DALI_TEST_EQUALS( 0.5f, animation.GetCurrentProgress(), TEST_LOCATION ); + + progressCheck.CheckSignalNotReceived(); + + application.Render(static_cast(durationSeconds*100.0f)/* 60% progress */); + application.SendNotification(); + + tet_infoline( "Animation at 60%" ); + + finishCheck.CheckSignalNotReceived(); + + application.Render(static_cast(durationSeconds*200.0f)/* 80% progress */); + application.SendNotification(); + DALI_TEST_EQUALS( 0.8f, animation.GetCurrentProgress(), TEST_LOCATION ); + tet_infoline( "Animation at 80%" ); + + application.Render(static_cast(durationSeconds*200.0f) + 1u/*just beyond the animation duration*/); + // We did expect the animation to finish + application.SendNotification(); + finishCheck.CheckSignalReceived(); + tet_infoline( "Animation finished" ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); + + END_TEST; +} + +int UtcDaliAnimationPlayAfterP(void) +{ + TestApplication application; + + tet_printf("Testing that playing after 2 seconds\n"); + + { + Actor actor = Actor::New(); + Stage::GetCurrent().Add(actor); + + // Build the animation + float durationSeconds(1.0f); + Animation animation = Animation::New(durationSeconds); + + bool signalReceived( false ); + AnimationFinishCheck finishCheck( signalReceived ); + animation.FinishedSignal().Connect( &application, finishCheck ); + application.SendNotification(); + + Vector3 targetPosition( 100.0f, 100.0f, 100.0f ); + animation.AnimateTo( Property( actor, Actor::Property::POSITION ), targetPosition, AlphaFunction::LINEAR, TimePeriod( 0.5f, 0.5f ) ); + + // Play animation after the initial delay time + animation.PlayAfter( 0.2f ); + application.SendNotification(); + application.Render(0); // start animation + + application.Render( durationSeconds * 200.f ); // The intial delay time of PlayAfter + application.SendNotification(); + finishCheck.CheckSignalNotReceived(); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), ( targetPosition * 0.0f ), TEST_LOCATION ); // Not move + + application.Render( static_cast< unsigned int >( durationSeconds * 500.0f )/* 50% animation progress, 0% animator progress */ ); + + // We didn't expect the animation to finish yet + application.SendNotification(); + finishCheck.CheckSignalNotReceived(); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), ( targetPosition * 0.0f ), TEST_LOCATION ); // Not move - A delay time of TimePeriod in seconds + + application.SendNotification(); + application.Render( static_cast< unsigned int >( durationSeconds * 250.0f )/* 75% animation progress, 50% animator progress */ ); + + application.SendNotification(); + finishCheck.CheckSignalNotReceived(); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), ( targetPosition * 0.5f ), TEST_LOCATION ); + + application.SendNotification(); + application.Render( static_cast< unsigned int >( durationSeconds * 250.0f ) + 1u/*just beyond the animation duration*/ ); + + // We did expect the animation to finish + application.SendNotification(); + finishCheck.CheckSignalReceived(); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); + + // Check that nothing has changed after a couple of buffer swaps + application.Render(0); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); + } + + tet_printf("Testing that playing after 2 seconds with negative speedfactor\n"); + // SpeedFactor < 0 + { + Actor actor = Actor::New(); + Stage::GetCurrent().Add(actor); + + // Build the animation + float durationSeconds(1.0f); + Animation animation = Animation::New(durationSeconds); + animation.SetSpeedFactor( -1.0f ); // Set SpeedFactor as < 0 + + bool signalReceived( false ); + AnimationFinishCheck finishCheck( signalReceived ); + animation.FinishedSignal().Connect( &application, finishCheck ); + application.SendNotification(); + + Vector3 targetPosition( 100.0f, 100.0f, 100.0f ); + animation.AnimateTo( Property( actor, Actor::Property::POSITION ), targetPosition, AlphaFunction::LINEAR, TimePeriod( 0.5f, 0.5f ) ); + + // Play animation after the initial delay time + animation.PlayAfter( 0.2f ); + application.SendNotification(); + application.Render(0); // start animation + + application.Render( durationSeconds * 200.f ); // The intial delay time of PlayAfter + application.SendNotification(); + finishCheck.CheckSignalNotReceived(); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), ( targetPosition * 1.0f ), TEST_LOCATION ); // Not move. NOTE SpeedFactor < 0 so 'targetPosition' is start position. + + application.Render( static_cast< unsigned int >( durationSeconds * 250.0f )/* 25% animation progress, 50% animator progress */ ); + + // We didn't expect the animation to finish yet + application.SendNotification(); + finishCheck.CheckSignalNotReceived(); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), ( targetPosition * 0.5f ), TEST_LOCATION ); + + application.SendNotification(); + application.Render( static_cast< unsigned int >( durationSeconds * 250.0f )/* 50% animation progress, 100% animator progress */ ); + + application.SendNotification(); + finishCheck.CheckSignalNotReceived(); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), ( targetPosition * 0.0f ), TEST_LOCATION ); + + application.SendNotification(); + application.Render( static_cast< unsigned int >( durationSeconds * 500.0f ) + 1u/*just beyond the animation duration*/ ); + + // We did expect the animation to finish + application.SendNotification(); + finishCheck.CheckSignalReceived(); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), ( targetPosition * 0.0f ), TEST_LOCATION ); // Not move - A delay time of Timeperiod in seconds + + // Check that nothing has changed after a couple of buffer swaps + application.Render(0); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(0.0, 0.0, 0.0), TEST_LOCATION ); + } + + END_TEST; +} + +int UtcDaliAnimationPlayAfterP2(void) +{ + TestApplication application; + + tet_printf("Testing that playing after 2 seconds before looping\n"); + + { + Actor actor = Actor::New(); + Stage::GetCurrent().Add(actor); + + // Build the animation + float durationSeconds(1.0f); + Animation animation = Animation::New(durationSeconds); + animation.SetLooping( true ); + + bool signalReceived( false ); + AnimationFinishCheck finishCheck( signalReceived ); + animation.FinishedSignal().Connect( &application, finishCheck ); + application.SendNotification(); + + Vector3 targetPosition( 100.0f, 100.0f, 100.0f ); + animation.AnimateTo( Property( actor, Actor::Property::POSITION ), targetPosition, AlphaFunction::LINEAR, TimePeriod( 0.5f, 0.5f ) ); + + // Play animation after the initial delay time + animation.PlayAfter( 0.2f ); + application.SendNotification(); + application.Render(0); // start animation + + for( int iterations = 0; iterations < 3; ++iterations ) + { + // The initial delay time of PlayAfter() applies only once in looping mode. + if( iterations == 0 ) + { + application.Render( durationSeconds * 200.f ); // The intial delay time of PlayAfter + application.SendNotification(); + finishCheck.CheckSignalNotReceived(); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), ( targetPosition * 0.0f ), TEST_LOCATION ); // Not move + } + + application.Render( static_cast< unsigned int >( durationSeconds * 500.0f )/* 50% animation progress, 0% animator progress */ ); + + // We didn't expect the animation to finish yet + application.SendNotification(); + finishCheck.CheckSignalNotReceived(); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), ( targetPosition * 0.0f ), TEST_LOCATION ); // Not move - A delay time of TimePeriod in seconds + + application.SendNotification(); + application.Render( static_cast< unsigned int >( durationSeconds * 250.0f )/* 75% animation progress, 50% animator progress */ ); + + application.SendNotification(); + finishCheck.CheckSignalNotReceived(); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), ( targetPosition * 0.5f ), TEST_LOCATION ); + + application.SendNotification(); + application.Render( static_cast< unsigned int >( durationSeconds * 250.0f ) /* 100% progress */ ); + + // We did expect the animation to finish + application.SendNotification(); + finishCheck.CheckSignalNotReceived(); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); + } + + animation.SetLooping(false); + application.SendNotification(); + application.Render( static_cast< unsigned int >( durationSeconds * 1000.0f ) + 1u /*just beyond the animation duration*/ ); + + application.SendNotification(); + finishCheck.CheckSignalReceived(); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); + } + + tet_printf("Testing that playing after 2 seconds before looping with negative speedfactor\n"); + // SpeedFactor < 0 + { + Actor actor = Actor::New(); + Stage::GetCurrent().Add(actor); + + // Build the animation + float durationSeconds(1.0f); + Animation animation = Animation::New(durationSeconds); + animation.SetLooping( true ); + animation.SetSpeedFactor( -1.0f ); //Set SpeedFactor as < 0 + + bool signalReceived( false ); + AnimationFinishCheck finishCheck( signalReceived ); + animation.FinishedSignal().Connect( &application, finishCheck ); + application.SendNotification(); + + Vector3 targetPosition( 100.0f, 100.0f, 100.0f ); + animation.AnimateTo( Property( actor, Actor::Property::POSITION ), targetPosition, AlphaFunction::LINEAR, TimePeriod( 0.5f, 0.5f ) ); + + // Play animation after the initial delay time + animation.PlayAfter( 0.2f ); + application.SendNotification(); + application.Render(0); // start animation + + for( int iterations = 0; iterations < 3; ++iterations ) + { + // The initial delay time of PlayAfter() applies only once in looping mode. + if( iterations == 0 ) + { + application.Render( durationSeconds * 200.f ); // The intial delay time of PlayAfter + application.SendNotification(); + finishCheck.CheckSignalNotReceived(); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), ( targetPosition * 1.0f ), TEST_LOCATION ); // Not move. NOTE SpeedFactor < 0 so 'targetPosition' is start position. + } + + application.Render( static_cast< unsigned int >( durationSeconds * 250.0f )/* 25% animation progress, 50% animator progress */ ); + + // We didn't expect the animation to finish yet + application.SendNotification(); + finishCheck.CheckSignalNotReceived(); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), ( targetPosition * 0.5f ), TEST_LOCATION ); + + application.SendNotification(); + application.Render( static_cast< unsigned int >( durationSeconds * 250.0f )/* 50% animation progress, 100% animator progress */ ); + + application.SendNotification(); + finishCheck.CheckSignalNotReceived(); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), ( targetPosition * 0.0f ), TEST_LOCATION ); + + application.SendNotification(); + application.Render( static_cast< unsigned int >( durationSeconds * 500.0f ) /* 100% progress */ ); + + // We did expect the animation to finish + application.SendNotification(); + finishCheck.CheckSignalNotReceived(); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), ( targetPosition * 0.0f ), TEST_LOCATION ); // Not move - A delay time of TimePeriod in second + } + + animation.SetLooping(false); + application.SendNotification(); + application.Render( static_cast< unsigned int >( durationSeconds * 1000.0f ) + 1u /*just beyond the animation duration*/ ); + + application.SendNotification(); + finishCheck.CheckSignalReceived(); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(0.0, 0.0, 0.0), TEST_LOCATION ); + } + + END_TEST; +} + +int UtcDaliAnimationPlayAfterP3(void) +{ + TestApplication application; + + tet_printf("Testing that PlayAfter with the negative delay seconds\n"); + + Actor actor = Actor::New(); + Stage::GetCurrent().Add(actor); + + // Build the animation + float durationSeconds(1.0f); + Animation animation = Animation::New(durationSeconds); + + bool signalReceived( false ); + AnimationFinishCheck finishCheck( signalReceived ); + animation.FinishedSignal().Connect( &application, finishCheck ); + application.SendNotification(); + + Vector3 targetPosition( 100.0f, 100.0f, 100.0f ); + animation.AnimateTo( Property( actor, Actor::Property::POSITION ), targetPosition, AlphaFunction::LINEAR, TimePeriod( 0.5f, 0.5f ) ); + + // When the delay time is negative value, it would treat as play immediately. + animation.PlayAfter( -2.0f ); + application.SendNotification(); + application.Render(0); // start animation + + application.Render( static_cast< unsigned int >( durationSeconds * 500.0f )/* 50% animation progress, 0% animator progress */ ); + + // We didn't expect the animation to finish yet + application.SendNotification(); + finishCheck.CheckSignalNotReceived(); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), ( targetPosition * 0.0f ), TEST_LOCATION ); // Not move - A delay time of TimePeriod in seconds + + application.SendNotification(); + application.Render( static_cast< unsigned int >( durationSeconds * 250.0f )/* 75% animation progress, 50% animator progress */ ); + + application.SendNotification(); + finishCheck.CheckSignalNotReceived(); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), ( targetPosition * 0.5f ), TEST_LOCATION ); + + application.SendNotification(); + application.Render( static_cast< unsigned int >( durationSeconds * 250.0f ) + 1u/*just beyond the animation duration*/ ); + + // We did expect the animation to finish + application.SendNotification(); + finishCheck.CheckSignalReceived(); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); + + // Check that nothing has changed after a couple of buffer swaps + application.Render(0); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); + END_TEST; +} + +int UtcDaliAnimationPlayAfterP4(void) +{ + TestApplication application; + + tet_printf("Testing that PlayAfter with progress value\n"); + + Actor actor = Actor::New(); + Stage::GetCurrent().Add(actor); + + // Build the animation + float durationSeconds(1.0f); + Animation animation = Animation::New(durationSeconds); + + bool signalReceived( false ); + AnimationFinishCheck finishCheck( signalReceived ); + animation.FinishedSignal().Connect( &application, finishCheck ); + application.SendNotification(); + + Vector3 targetPosition( 100.0f, 100.0f, 100.0f ); + animation.AnimateTo( Property( actor, Actor::Property::POSITION ), targetPosition, AlphaFunction::LINEAR, TimePeriod( 0.5f, 0.5f ) ); + + // Delay time is 0.3s. So after duration times, progress must be 70%. animation will finished at 1.3s. + animation.PlayAfter( durationSeconds * 0.3f ); + application.SendNotification(); + application.Render(0); // start animation + + application.Render( static_cast< unsigned int >( durationSeconds * 250.0f )/* 5/6 delay progress, 0% animation progress, 0% animator progress */ ); + + // We didn't expect the animation to finish yet + application.SendNotification(); + finishCheck.CheckSignalNotReceived(); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), ( targetPosition * 0.0f ), TEST_LOCATION ); // Not move - A delay time of PlayAfter + + application.SendNotification(); + application.Render( static_cast< unsigned int >( durationSeconds * 250.0f )/* 100% delay progress, 20% animation progress, 0% animator progress */ ); + + application.SendNotification(); + finishCheck.CheckSignalNotReceived(); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), ( targetPosition * 0.0f ), TEST_LOCATION ); // Not move - A delay time of TimePeriod in seconds + + application.SendNotification(); + application.Render( static_cast< unsigned int >( durationSeconds * 250.0f )/* 100% delay progress, 45% animation progress, 0% animator progress */ ); + + application.SendNotification(); + finishCheck.CheckSignalNotReceived(); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), ( targetPosition * 0.0f ), TEST_LOCATION ); // Not move - A delay time of TimePeriod in seconds + + application.SendNotification(); + application.Render( static_cast< unsigned int >( durationSeconds * 250.0f )/* 100% delay progress, 70% animation progress, 40% animator progress */ ); + + application.SendNotification(); + finishCheck.CheckSignalNotReceived(); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), ( targetPosition * 0.4f ), TEST_LOCATION ); // 40% of animator progress + + application.SendNotification(); + application.Render( static_cast< unsigned int >( durationSeconds * 250.0f )/* 100% delay progress, 95% animation progress, 90% animator progress */ ); + + application.SendNotification(); + finishCheck.CheckSignalNotReceived(); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), ( targetPosition * 0.9f ), TEST_LOCATION ); // 90% of animator progress + + application.SendNotification(); + application.Render( static_cast< unsigned int >( durationSeconds * 50.0f ) + 1u/*just beyond the animation duration*/ ); + + // We did expect the animation to finish + application.SendNotification(); + finishCheck.CheckSignalReceived(); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); + + // Check that nothing has changed after a couple of buffer swaps + application.Render(0); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); + END_TEST; +} + +int UtcDaliAnimationSetLoopingModeP(void) +{ + // Test Loop forever and Loop mode being set + TestApplication application; + Stage stage( Stage::GetCurrent() ); + + // Default: LoopingMode::RESTART + { + Actor actor = Actor::New(); + stage.Add( actor ); + + float durationSeconds( 1.0f ); + Animation animation = Animation::New( durationSeconds ); + DALI_TEST_CHECK( animation.GetLoopingMode() == Animation::RESTART ); + + Vector3 targetPosition(10.0f, 10.0f, 10.0f); + animation.AnimateTo( Property( actor, Actor::Property::POSITION ), targetPosition ); + + // Start the animation + animation.Play(); + application.SendNotification(); + application.Render(static_cast(durationSeconds*0.5f*1000.0f)/*Only half the animation*/); + + actor.Unparent(); + + application.SendNotification(); + application.Render(); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); + } + + // LoopingMode::AUTO_REVERSE + { + Actor actor = Actor::New(); + stage.Add( actor ); + + float durationSeconds( 1.0f ); + Animation animation = Animation::New( durationSeconds ); + animation.SetLooping( true ); + + bool signalReceived( false ); + AnimationFinishCheck finishCheck( signalReceived ); + animation.FinishedSignal().Connect( &application, finishCheck ); + application.SendNotification(); + + Vector3 targetPosition(100.0f, 100.0f, 100.0f); + animation.AnimateTo( Property( actor, Actor::Property::POSITION ), targetPosition ); + + animation.SetLoopingMode( Animation::LoopingMode::AUTO_REVERSE ); + DALI_TEST_CHECK( animation.GetLoopingMode() == Animation::AUTO_REVERSE ); + + // Start the animation + animation.Play(); + application.SendNotification(); + application.Render(0); + + for( int iterations = 0; iterations < 3; ++iterations ) + { + application.Render( static_cast< unsigned int >( durationSeconds * 500.0f )/* 50% time progress */ ); + application.SendNotification(); + finishCheck.CheckSignalNotReceived(); + + // AUTO_REVERSE mode means, for Animation duration time, the actor starts from the beginning, passes the targetPosition, + // and arrives at the beginning. + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); + + application.SendNotification(); + application.Render( static_cast< unsigned int >( durationSeconds * 500.0f )/* 100% time progress */ ); + + // We did expect the animation to finish + application.SendNotification(); + finishCheck.CheckSignalNotReceived(); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), TEST_LOCATION ); + } + + animation.SetLooping( false ); + application.SendNotification(); + application.Render(static_cast< unsigned int >( durationSeconds * 1000.0f ) + 1u /*just beyond the animation duration*/); + + application.SendNotification(); + finishCheck.CheckSignalReceived(); + + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), TEST_LOCATION ); + } + + // LoopingMode::AUTO_REVERSE in Reverse mode, which begin from the end + { + Actor actor = Actor::New(); + stage.Add( actor ); + + float durationSeconds( 1.0f ); + Animation animation = Animation::New( durationSeconds ); + animation.SetLooping( true ); + + bool signalReceived( false ); + AnimationFinishCheck finishCheck( signalReceived ); + animation.FinishedSignal().Connect( &application, finishCheck ); + application.SendNotification(); + + // Specify a negative multiplier to play the animation in reverse + animation.SetSpeedFactor( -1.0f ); + + Vector3 targetPosition(100.0f, 100.0f, 100.0f); + animation.AnimateTo( Property( actor, Actor::Property::POSITION ), targetPosition ); + + animation.SetLoopingMode( Animation::AUTO_REVERSE ); + DALI_TEST_CHECK( animation.GetLoopingMode() == Animation::AUTO_REVERSE ); + + // Start the animation + animation.Play(); + application.SendNotification(); + application.Render(0); + + for( int iterations = 0; iterations < 3; ++iterations ) + { + application.Render( static_cast< unsigned int >( durationSeconds * 500.0f )/* 50% time progress */ ); + application.SendNotification(); + finishCheck.CheckSignalNotReceived(); + + // Setting a negative speed factor is to play the animation in reverse. + // So, when LoopingMode::AUTO_REVERSE and SetSpeedFactor( -1.0f ) is, for Animation duration time, + // the actor starts from the targetPosition, passes the beginning, and arrives at the targetPosition. + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), TEST_LOCATION ); + + application.SendNotification(); + application.Render( static_cast< unsigned int >( durationSeconds * 500.0f )/* 100% time progress */ ); + + // We did expect the animation to finish + application.SendNotification(); + finishCheck.CheckSignalNotReceived(); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); + } + + animation.SetLooping( false ); + application.SendNotification(); + application.Render(static_cast< unsigned int >( durationSeconds * 1000.0f ) + 1u /*just beyond the animation duration*/); + + application.SendNotification(); + finishCheck.CheckSignalReceived(); + + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); + } + + END_TEST; +} + +int UtcDaliAnimationSetLoopingModeP2(void) +{ + // Test Loop Count and Loop mode being set + TestApplication application; + Stage stage( Stage::GetCurrent() ); + + // LoopingMode::AUTO_REVERSE + { + Actor actor = Actor::New(); + stage.Add( actor ); + + float durationSeconds( 1.0f ); + Animation animation = Animation::New( durationSeconds ); + animation.SetLoopCount(3); + DALI_TEST_CHECK(animation.IsLooping()); + + bool signalReceived( false ); + AnimationFinishCheck finishCheck( signalReceived ); + animation.FinishedSignal().Connect( &application, finishCheck ); + application.SendNotification(); + + Vector3 targetPosition(100.0f, 100.0f, 100.0f); + animation.AnimateTo( Property( actor, Actor::Property::POSITION ), targetPosition ); + + animation.SetLoopingMode( Animation::AUTO_REVERSE ); + DALI_TEST_CHECK( animation.GetLoopingMode() == Animation::AUTO_REVERSE ); + + // Start the animation + animation.Play(); + + application.Render(0); + application.SendNotification(); + application.Render(0); + application.SendNotification(); + application.Render(0); + application.SendNotification(); + application.Render(0); + application.SendNotification(); + + // Loop + float intervalSeconds = 3.0f; + + application.Render(static_cast(durationSeconds*intervalSeconds*1000.0f)); + // AUTO_REVERSE mode means, for Animation duration time, the actor starts from the beginning, passes the targetPosition, + // and arrives at the beginning. + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), TEST_LOCATION ); + + application.Render(static_cast(durationSeconds*intervalSeconds*1000.0f)); + + application.Render(0); + application.SendNotification(); + application.Render(0); + application.SendNotification(); + application.Render(0); + application.SendNotification(); + application.Render(0); + application.SendNotification(); + finishCheck.CheckSignalNotReceived(); + + application.Render(static_cast(durationSeconds*intervalSeconds*1000.0f)); + + application.SendNotification(); + finishCheck.CheckSignalReceived(); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), TEST_LOCATION ); + + finishCheck.Reset(); + } + + // LoopingMode::AUTO_REVERSE in Reverse mode, which begin from the end + { + Actor actor = Actor::New(); + stage.Add( actor ); + + float durationSeconds( 1.0f ); + Animation animation = Animation::New( durationSeconds ); + animation.SetLoopCount(3); + DALI_TEST_CHECK(animation.IsLooping()); + + bool signalReceived( false ); + AnimationFinishCheck finishCheck( signalReceived ); + animation.FinishedSignal().Connect( &application, finishCheck ); + application.SendNotification(); + + // Specify a negative multiplier to play the animation in reverse + animation.SetSpeedFactor( -1.0f ); + + Vector3 targetPosition(100.0f, 100.0f, 100.0f); + animation.AnimateTo( Property( actor, Actor::Property::POSITION ), targetPosition ); + + animation.SetLoopingMode( Animation::AUTO_REVERSE ); + DALI_TEST_CHECK( animation.GetLoopingMode() == Animation::AUTO_REVERSE ); + + // Start the animation + animation.Play(); + + application.Render(0); + application.SendNotification(); + application.Render(0); + application.SendNotification(); + application.Render(0); + application.SendNotification(); + application.Render(0); + application.SendNotification(); + + // Loop + float intervalSeconds = 3.0f; + + application.Render(static_cast(durationSeconds*intervalSeconds*1000.0f)); + // Setting a negative speed factor is to play the animation in reverse. + // So, when LoopingMode::AUTO_REVERSE and SetSpeedFactor( -1.0f ) is, for Animation duration time, + // the actor starts from the targetPosition, passes the beginning, and arrives at the targetPosition. + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); + + application.Render(static_cast(durationSeconds*intervalSeconds*1000.0f)); + + application.Render(0); + application.SendNotification(); + application.Render(0); + application.SendNotification(); + application.Render(0); + application.SendNotification(); + application.Render(0); + application.SendNotification(); + finishCheck.CheckSignalNotReceived(); + + application.Render(static_cast(durationSeconds*intervalSeconds*1000.0f)); + + application.SendNotification(); + finishCheck.CheckSignalReceived(); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); + + finishCheck.Reset(); + } + + END_TEST; +} + +int UtcDaliAnimationSetLoopingModeP3(void) +{ + // Test Loop Count is 1 (== default) and Loop mode being set + TestApplication application; + Stage stage( Stage::GetCurrent() ); + + // LoopingMode::AUTO_REVERSE + { + Actor actor = Actor::New(); + stage.Add( actor ); + + float durationSeconds( 1.0f ); + Animation animation = Animation::New( durationSeconds ); + DALI_TEST_CHECK(1 == animation.GetLoopCount()); + + bool signalReceived( false ); + AnimationFinishCheck finishCheck( signalReceived ); + animation.FinishedSignal().Connect( &application, finishCheck ); + application.SendNotification(); + + Vector3 targetPosition(100.0f, 100.0f, 100.0f); + animation.AnimateTo( Property( actor, Actor::Property::POSITION ), targetPosition ); + + animation.SetLoopingMode( Animation::AUTO_REVERSE ); + DALI_TEST_CHECK( animation.GetLoopingMode() == Animation::AUTO_REVERSE ); + + // Start the animation + animation.Play(); + application.Render(0); + application.SendNotification(); + + application.Render( static_cast< unsigned int >( durationSeconds * 0.5f * 1000.0f )/* 50% time progress */ ); + application.SendNotification(); + finishCheck.CheckSignalNotReceived(); + + // AUTO_REVERSE mode means, for Animation duration time, the actor starts from the beginning, passes the targetPosition, + // and arrives at the beginning. + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); + + application.SendNotification(); + application.Render( static_cast< unsigned int >( durationSeconds * 0.5f * 1000.0f )/* 100% time progress */ ); + + application.SendNotification(); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), TEST_LOCATION ); + + application.SendNotification(); + application.Render( static_cast< unsigned int >( durationSeconds * 1.0f * 1000.0f ) + 1u /*just beyond the animation duration*/ ); + + application.SendNotification(); + application.Render(0); + application.SendNotification(); + finishCheck.CheckSignalReceived(); + + // After all animation finished, arrives at the beginning. + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), TEST_LOCATION ); + + finishCheck.Reset(); + } + + // LoopingMode::AUTO_REVERSE in Reverse mode, which begin from the end + { + Actor actor = Actor::New(); + stage.Add( actor ); + + float durationSeconds( 1.0f ); + Animation animation = Animation::New( durationSeconds ); + DALI_TEST_CHECK(1 == animation.GetLoopCount()); + + bool signalReceived( false ); + AnimationFinishCheck finishCheck( signalReceived ); + animation.FinishedSignal().Connect( &application, finishCheck ); + application.SendNotification(); + + // Specify a negative multiplier to play the animation in reverse + animation.SetSpeedFactor( -1.0f ); + + Vector3 targetPosition(100.0f, 100.0f, 100.0f); + animation.AnimateTo( Property( actor, Actor::Property::POSITION ), targetPosition ); + + animation.SetLoopingMode( Animation::AUTO_REVERSE ); + DALI_TEST_CHECK( animation.GetLoopingMode() == Animation::AUTO_REVERSE ); + + // Start the animation + animation.Play(); + application.Render(0); + application.SendNotification(); + + application.Render( static_cast< unsigned int >( durationSeconds * 0.5f * 1000.0f )/* 50% time progress */ ); + application.SendNotification(); + finishCheck.CheckSignalNotReceived(); + + // Setting a negative speed factor is to play the animation in reverse. + // So, when LoopingMode::AUTO_REVERSE and SetSpeedFactor( -1.0f ) is, for Animation duration time, + // the actor starts from the targetPosition, passes the beginning, and arrives at the targetPosition. + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), TEST_LOCATION ); + + application.SendNotification(); + application.Render( static_cast< unsigned int >( durationSeconds * 0.5f * 1000.0f )/* 100% time progress */ ); + + application.SendNotification(); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); + + application.SendNotification(); + application.Render( static_cast< unsigned int >( durationSeconds * 1.0f * 1000.0f ) + 1u /*just beyond the animation duration*/ ); + + application.SendNotification(); + application.Render(0); + application.SendNotification(); + finishCheck.CheckSignalReceived(); + + // After all animation finished, arrives at the target. + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); + + finishCheck.Reset(); + } + + END_TEST; +} + +int UtcDaliAnimationGetLoopingModeP(void) +{ + TestApplication application; + + Animation animation = Animation::New(1.0f); + + // default mode + DALI_TEST_CHECK( animation.GetLoopingMode() == Animation::RESTART ); + + animation.SetLoopingMode( Animation::AUTO_REVERSE ); + DALI_TEST_CHECK( animation.GetLoopingMode() == Animation::AUTO_REVERSE ); + + END_TEST; +} + +int UtcDaliAnimationProgressSignalConnectionWithoutProgressMarkerP(void) +{ + TestApplication application; + + tet_infoline( "Connect to ProgressReachedSignal but do not set a required Progress marker" ); + + Actor actor = Actor::New(); + Stage::GetCurrent().Add(actor); + + // Build the animation + Animation animation = Animation::New(0.0f); + + //Set duration + float durationSeconds(1.0f); + animation.SetDuration(durationSeconds); + + bool finishedSignalReceived(false); + bool progressSignalReceived(false); + + AnimationFinishCheck finishCheck(finishedSignalReceived); + animation.FinishedSignal().Connect(&application, finishCheck); + + AnimationProgressCheck progressCheck( progressSignalReceived ); + DevelAnimation::ProgressReachedSignal( animation ).Connect( &application, progressCheck); + application.SendNotification(); + + Vector3 targetPosition(100.0f, 100.0f, 100.0f); + animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR); + + progressCheck.CheckSignalNotReceived(); + + animation.Play(); + + application.SendNotification(); + application.Render(0); // start animation + application.Render(durationSeconds*100.0f ); // 10% progress + application.SendNotification(); + + tet_infoline( "Ensure after animation has started playing that ProgressReachedSignal not emitted" ); + progressCheck.CheckSignalNotReceived(); + + application.Render(static_cast(durationSeconds*900.0f) + 1u/*just beyond the animation duration*/); + + application.SendNotification(); + finishCheck.CheckSignalReceived(); + tet_infoline( "Animation finished" ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); + + END_TEST; +} + +int UtcDaliAnimationMultipleProgressSignalsP(void) +{ + tet_infoline( "Multiple animations with different progress markers" ); + + TestApplication application; + + Actor actor = Actor::New(); + Stage::GetCurrent().Add(actor); + + // Build the animation + Animation animationAlpha = Animation::New(0.0f); + Animation animationBeta = Animation::New(0.0f); + + //Set duration + float durationSeconds(1.0f); + animationAlpha.SetDuration(durationSeconds); + animationBeta.SetDuration(durationSeconds); + + bool progressSignalReceivedAlpha(false); + bool progressSignalReceivedBeta(false); + + AnimationProgressCheck progressCheckAlpha(progressSignalReceivedAlpha, "animation:Alpha"); + AnimationProgressCheck progressCheckBeta(progressSignalReceivedBeta, "animation:Beta" ); + + DevelAnimation::ProgressReachedSignal( animationAlpha ).Connect( &application, progressCheckAlpha ); + DevelAnimation::ProgressReachedSignal( animationBeta ).Connect( &application, progressCheckBeta); + application.SendNotification(); + + Vector3 targetPosition(100.0f, 100.0f, 100.0f); + animationAlpha.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR); + animationBeta.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR); + + tet_infoline( "AnimationAlpha Progress notification set to 30%" ); + DevelAnimation::SetProgressNotification( animationAlpha, 0.3f ); + + tet_infoline( "AnimationBeta Progress notification set to 50%" ); + DevelAnimation::SetProgressNotification( animationBeta, 0.5f ); + + application.SendNotification(); + application.Render( ); + + progressCheckAlpha.CheckSignalNotReceived(); + progressCheckBeta.CheckSignalNotReceived(); + + // Start the animations from 10% progress + animationAlpha.SetCurrentProgress( 0.1f ); + animationBeta.SetCurrentProgress( 0.1f ); + animationAlpha.Play(); + animationBeta.Play(); + + tet_infoline( "Animation Playing from 10%" ); + + application.SendNotification(); + application.Render(0); // start animation + application.Render(durationSeconds*100.0f ); // 20% progress + + tet_infoline( "Animation at 20% - No signals to be received" ); + + progressCheckAlpha.CheckSignalNotReceived(); + progressCheckBeta.CheckSignalNotReceived(); + + application.SendNotification(); + application.Render(durationSeconds*200.0f ); // 40% progress + application.SendNotification(); + tet_infoline( "Animation at 40% - Alpha signal should be received" ); + DALI_TEST_EQUALS( 0.4f, animationAlpha.GetCurrentProgress(), TEST_LOCATION ); + + progressCheckAlpha.CheckSignalReceived(); + progressCheckBeta.CheckSignalNotReceived(); + + tet_infoline( "Progress check reset" ); + progressCheckAlpha.Reset(); + progressCheckBeta.Reset(); + + application.Render(durationSeconds*100.0f ); // 50% progress + tet_infoline( "Animation at 50% - Beta should receive signal, Alpha should not" ); + application.SendNotification(); + + DALI_TEST_EQUALS( 0.5f, animationBeta.GetCurrentProgress(), TEST_LOCATION ); + + progressCheckAlpha.CheckSignalNotReceived(); + progressCheckBeta.CheckSignalReceived(); + tet_infoline( "Progress check reset" ); + progressCheckAlpha.Reset(); + progressCheckBeta.Reset(); + + application.Render(static_cast(durationSeconds*100.0f)/* 60% progress */); + application.SendNotification(); + + tet_infoline( "Animation at 60%" ); + + progressCheckAlpha.CheckSignalNotReceived(); + progressCheckBeta.CheckSignalNotReceived(); + + application.Render(static_cast(durationSeconds*200.0f)/* 80% progress */); + application.SendNotification(); + tet_infoline( "Animation at 80%" ); + + progressCheckAlpha.CheckSignalNotReceived(); + progressCheckBeta.CheckSignalNotReceived(); + + application.Render(static_cast(durationSeconds*200.0f) + 1u/*just beyond the animation duration*/); + // We did expect the animation to finish + tet_infoline( "Animation finished" ); + + END_TEST; +} + +int UtcDaliAnimationMultipleProgressSignalsP2(void) +{ + tet_infoline( "Multiple animations with different progress markers and big step time" ); + + TestApplication application; + + Actor actor = Actor::New(); + Stage::GetCurrent().Add(actor); + + // Build the animation + Animation animationAlpha = Animation::New(0.0f); + Animation animationBeta = Animation::New(0.0f); + + //Set duration + const float durationSeconds(1.0f); + animationAlpha.SetDuration(durationSeconds); + animationBeta.SetDuration(durationSeconds); + + bool progressSignalReceivedAlpha(false); + bool progressSignalReceivedBeta(false); + + AnimationProgressCheck progressCheckAlpha(progressSignalReceivedAlpha, "animation:Alpha"); + AnimationProgressCheck progressCheckBeta(progressSignalReceivedBeta, "animation:Beta" ); + + DevelAnimation::ProgressReachedSignal( animationAlpha ).Connect( &application, progressCheckAlpha ); + DevelAnimation::ProgressReachedSignal( animationBeta ).Connect( &application, progressCheckBeta); + application.SendNotification(); + + Vector3 targetPosition(100.0f, 100.0f, 100.0f); + animationAlpha.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR); + animationBeta.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR); + + tet_infoline( "AnimationAlpha Progress notification set to 1%" ); + DevelAnimation::SetProgressNotification( animationAlpha, 0.01f ); + + tet_infoline( "AnimationBeta Progress notification set to 99%" ); + DevelAnimation::SetProgressNotification( animationBeta, 0.99f ); + + application.SendNotification(); + application.Render( ); + + progressCheckAlpha.CheckSignalNotReceived(); + progressCheckBeta.CheckSignalNotReceived(); + + // Start the animations unlimited looping + animationAlpha.SetLooping( true ); + animationBeta.SetLooping( true ); + animationAlpha.Play(); + animationBeta.Play(); + + application.SendNotification(); + application.Render(0); // start animation + application.Render(durationSeconds*20.0f ); // 2% progress + application.SendNotification(); + DALI_TEST_EQUALS( 0.02f, animationAlpha.GetCurrentProgress(), TEST_LOCATION ); + + tet_infoline( "Animation at 2% - Alpha signals should be received, Beta should not." ); + + progressCheckAlpha.CheckSignalReceived(); + progressCheckBeta.CheckSignalNotReceived(); + + tet_infoline( "Progress check reset" ); + progressCheckAlpha.Reset(); + progressCheckBeta.Reset(); + + application.SendNotification(); + application.Render(durationSeconds*960.0f ); // 98% progress + application.SendNotification(); + tet_infoline( "Animation at 98% - No signal received" ); + DALI_TEST_EQUALS( 0.98f, animationAlpha.GetCurrentProgress(), TEST_LOCATION ); + + progressCheckAlpha.CheckSignalNotReceived(); + progressCheckBeta.CheckSignalNotReceived(); + + application.SendNotification(); + application.Render(durationSeconds*40.0f ); // 2% progress + application.SendNotification(); + tet_infoline( "Animation loop once and now 2% - Alpha and Beta should receive signal" ); + application.SendNotification(); + + DALI_TEST_EQUALS( 0.02f, animationBeta.GetCurrentProgress(), TEST_LOCATION ); + + progressCheckAlpha.CheckSignalReceived(); + progressCheckBeta.CheckSignalReceived(); + + tet_infoline( "Progress check reset" ); + progressCheckAlpha.Reset(); + progressCheckBeta.Reset(); + + application.SendNotification(); + application.Render(durationSeconds*980.0f ); // 100% progress + application.SendNotification(); + tet_infoline( "Animation loop one more time. and now 100% - Beta should receive signal, Alhpa sholud not" ); + application.SendNotification(); + + progressCheckAlpha.CheckSignalNotReceived(); + progressCheckBeta.CheckSignalReceived(); + + tet_infoline( "Progress check reset" ); + progressCheckAlpha.Reset(); + progressCheckBeta.Reset(); + + animationAlpha.SetLooping( false ); + animationBeta.SetLooping( false ); + + application.SendNotification(); + application.Render(static_cast(durationSeconds*2000.0f) + 1u/*just beyond the animation duration*/); + application.SendNotification(); + + // We did expect the animation to finish + tet_infoline( "Animation finished" ); + + END_TEST; +} + +int UtcDaliAnimationProgressSignalWithPlayAfterP(void) +{ + tet_infoline( "Multiple animations with different progress markers" ); + + TestApplication application; + + Actor actor = Actor::New(); + Stage::GetCurrent().Add(actor); + + // Build the animation + Animation animationAlpha = Animation::New(0.0f); + Animation animationBeta = Animation::New(0.0f); + + //Set duration + float durationSeconds(1.0f); + float delaySeconds(0.5f); + animationAlpha.SetDuration(durationSeconds); + animationBeta.SetDuration(durationSeconds); + + bool progressSignalReceivedAlpha(false); + bool progressSignalReceivedBeta(false); + + AnimationProgressCheck progressCheckAlpha(progressSignalReceivedAlpha, "animation:Alpha"); + AnimationProgressCheck progressCheckBeta(progressSignalReceivedBeta, "animation:Beta" ); + + DevelAnimation::ProgressReachedSignal( animationAlpha ).Connect( &application, progressCheckAlpha ); + DevelAnimation::ProgressReachedSignal( animationBeta ).Connect( &application, progressCheckBeta); + application.SendNotification(); + + Vector3 targetPosition(100.0f, 100.0f, 100.0f); + animationAlpha.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR); + animationBeta.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR); + + tet_infoline( "AnimationAlpha Progress notification set to 30%" ); + DevelAnimation::SetProgressNotification( animationAlpha, 0.3f ); + + tet_infoline( "AnimationBeta Progress notification set to ~0% (==Notify when delay is done)" ); + DevelAnimation::SetProgressNotification( animationBeta, Math::MACHINE_EPSILON_1 ); + + application.SendNotification(); + application.Render( ); + + progressCheckAlpha.CheckSignalNotReceived(); + progressCheckBeta.CheckSignalNotReceived(); + + // Start the animations from 10% progress + animationAlpha.PlayAfter(delaySeconds); + animationBeta.PlayAfter(delaySeconds); + + application.SendNotification(); + application.Render(0); // start animation + application.Render(delaySeconds * 500.0f ); // 50% wait progress + + tet_infoline( "Delay at 50% - No signals to be received" ); + + progressCheckAlpha.CheckSignalNotReceived(); + progressCheckBeta.CheckSignalNotReceived(); + + application.SendNotification(); + application.Render(delaySeconds * 500.0f + durationSeconds * 50.0f ); // 100% wait, 5% progress + application.SendNotification(); + tet_infoline( "Delay at 100%, Animation at 5% - Beta signal should be received" ); + DALI_TEST_EQUALS( 0.05f, animationBeta.GetCurrentProgress(), TEST_LOCATION ); + + progressCheckBeta.CheckSignalReceived(); + progressCheckAlpha.CheckSignalNotReceived(); + + tet_infoline( "Progress check reset" ); + progressCheckAlpha.Reset(); + progressCheckBeta.Reset(); + + application.Render(durationSeconds * 200.0f ); // 25% progress + tet_infoline( "Animation at 25% - No signals to be received" ); + application.SendNotification(); + + progressCheckAlpha.CheckSignalNotReceived(); + progressCheckBeta.CheckSignalNotReceived(); + + application.Render(durationSeconds * 200.0f ); // 45% progress + tet_infoline( "Animation at 45% - Alpha should receive signal, Beta should not" ); + application.SendNotification(); + + DALI_TEST_EQUALS( 0.45f, animationAlpha.GetCurrentProgress(), TEST_LOCATION ); + + progressCheckAlpha.CheckSignalReceived(); + progressCheckBeta.CheckSignalNotReceived(); + + tet_infoline( "Progress check reset" ); + progressCheckAlpha.Reset(); + progressCheckBeta.Reset(); + + application.Render(static_cast(durationSeconds*150.0f)/* 60% progress */); + application.SendNotification(); + + tet_infoline( "Animation at 60%" ); + + progressCheckAlpha.CheckSignalNotReceived(); + progressCheckBeta.CheckSignalNotReceived(); + + application.Render(static_cast(durationSeconds*200.0f)/* 80% progress */); + application.SendNotification(); + tet_infoline( "Animation at 80%" ); + + progressCheckAlpha.CheckSignalNotReceived(); + progressCheckBeta.CheckSignalNotReceived(); + + application.Render(static_cast(durationSeconds*200.0f) + 1u/*just beyond the animation duration*/); + // We did expect the animation to finish + tet_infoline( "Animation finished" ); + + END_TEST; +} + +int UtcDaliAnimationProgressCallbackWithLoopingP(void) +{ + TestApplication application; + + Actor actor = Actor::New(); + Stage::GetCurrent().Add(actor); + + // Build the animation + Animation animation = Animation::New(0.0f); + + //Set duration + const float durationSeconds(1.0f); + animation.SetDuration(durationSeconds); + + // Set Looping Count + const int loopCount( 4 ); + animation.SetLoopCount( loopCount ); + + bool finishedSignalReceived(false); + bool progressSignalReceived(false); + + AnimationFinishCheck finishCheck(finishedSignalReceived); + animation.FinishedSignal().Connect(&application, finishCheck); + + AnimationProgressCheck progressCheck(progressSignalReceived); + DevelAnimation::ProgressReachedSignal( animation ).Connect( &application, progressCheck); + application.SendNotification(); + + Vector3 targetPosition(100.0f, 100.0f, 100.0f); + animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR); + + tet_infoline( "Animation Progress notification set to 50% with looping count 4" ); + DevelAnimation::SetProgressNotification( animation, 0.5f ); + + application.SendNotification(); + application.Render( ); + + progressCheck.CheckSignalNotReceived(); + + animation.Play(); + + for(int count = 0; count < loopCount; count++) + { + application.SendNotification(); + application.Render(0); // start animation + application.Render(durationSeconds*0.25*1000.0f ); // 25% progress + DALI_TEST_EQUALS( 0.25f, animation.GetCurrentProgress(), TEST_LOCATION ); + + tet_infoline( "Animation at 25%" ); + + progressCheck.CheckSignalNotReceived(); + + application.SendNotification(); + application.Render(durationSeconds*0.25*1000.0f ); // 50% progress + application.SendNotification(); + tet_infoline( "Animation at 50%" ); + DALI_TEST_EQUALS( 0.5f, animation.GetCurrentProgress(), TEST_LOCATION ); + + progressCheck.CheckSignalReceived(); + + tet_infoline( "Progress check reset" ); + progressCheck.Reset(); + + application.Render(durationSeconds*0.25*1000.0f ); // 75% progress + tet_infoline( "Animation at 75%" ); + application.SendNotification(); + + DALI_TEST_EQUALS( 0.75f, animation.GetCurrentProgress(), TEST_LOCATION ); + + progressCheck.CheckSignalNotReceived(); + + application.Render(durationSeconds*0.25*1000.0f ); // 100% progress + tet_infoline( "Animation at 100%" ); + application.SendNotification(); + + //Nothing check at 100% progress. cause It can be both 100% and 0%. + application.SendNotification(); + } + application.Render(10u); + application.SendNotification(); + application.Render(0u); + application.SendNotification(); + + finishCheck.CheckSignalReceived(); + + END_TEST; +} + +int UtcDaliAnimationProgressCallbackWithLoopingP2(void) +{ + TestApplication application; + + Actor actor = Actor::New(); + Stage::GetCurrent().Add(actor); + + // Build the animation + Animation animation = Animation::New(0.0f); + + //Set duration + const float durationSeconds(1.0f); + animation.SetDuration(durationSeconds); + + // Set Looping Unlmited + animation.SetLooping( true ); + + bool finishedSignalReceived(false); + bool progressSignalReceived(false); + + AnimationFinishCheck finishCheck(finishedSignalReceived); + animation.FinishedSignal().Connect(&application, finishCheck); + + AnimationProgressCheck progressCheck(progressSignalReceived); + DevelAnimation::ProgressReachedSignal( animation ).Connect( &application, progressCheck); + application.SendNotification(); + + Vector3 targetPosition(100.0f, 100.0f, 100.0f); + animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR); + + tet_infoline( "Animation Progress notification set to 50% with unlimited looping" ); + DevelAnimation::SetProgressNotification( animation, 0.5f ); + + application.SendNotification(); + application.Render( ); + + progressCheck.CheckSignalNotReceived(); + + animation.Play(); + + for(int count = 0; count < 4; count++) + { + application.SendNotification(); + application.Render(0); // start animation + application.Render(durationSeconds*0.25*1000.0f ); // 25% progress + DALI_TEST_EQUALS( 0.25f, animation.GetCurrentProgress(), TEST_LOCATION ); + + tet_infoline( "Animation at 25%" ); + + progressCheck.CheckSignalNotReceived(); + + application.SendNotification(); + application.Render(durationSeconds*0.25*1000.0f ); // 50% progress + application.SendNotification(); + tet_infoline( "Animation at 50%" ); + DALI_TEST_EQUALS( 0.5f, animation.GetCurrentProgress(), TEST_LOCATION ); + + progressCheck.CheckSignalReceived(); + + tet_infoline( "Progress check reset" ); + progressCheck.Reset(); + + application.Render(durationSeconds*0.25*1000.0f ); // 75% progress + tet_infoline( "Animation at 75%" ); + application.SendNotification(); + + DALI_TEST_EQUALS( 0.75f, animation.GetCurrentProgress(), TEST_LOCATION ); + + progressCheck.CheckSignalNotReceived(); + + application.Render(durationSeconds*0.25*1000.0f ); // 100% progress + tet_infoline( "Animation at 100%" ); + application.SendNotification(); + + //Nothing check at 100% progress. cause It can be both 100% and 0%. + finishCheck.CheckSignalNotReceived(); + application.SendNotification(); + } + finishCheck.CheckSignalNotReceived(); + + animation.SetLooping( false ); + application.Render(0u); + application.SendNotification(); + application.Render(static_cast(durationSeconds * 1000.0f) + 10u); + application.SendNotification(); + application.Render(0u); + application.SendNotification(); + + finishCheck.CheckSignalReceived(); + + END_TEST; +} + +int UtcDaliAnimationProgressCallbackNegativeSpeed(void) +{ + TestApplication application; + + Actor actor = Actor::New(); + Stage::GetCurrent().Add(actor); + + // Build the animation + Animation animation = Animation::New(0.0f); + + //Set duration + const float durationSeconds(1.0f); + animation.SetDuration(durationSeconds); + + //Set speed negative + animation.SetSpeedFactor( -1.0f ); + + // Set Looping Unlmited + animation.SetLooping( true ); + + bool finishedSignalReceived(false); + bool progressSignalReceived(false); + + AnimationFinishCheck finishCheck(finishedSignalReceived); + animation.FinishedSignal().Connect(&application, finishCheck); + + AnimationProgressCheck progressCheck(progressSignalReceived); + DevelAnimation::ProgressReachedSignal( animation ).Connect( &application, progressCheck); + application.SendNotification(); + + Vector3 targetPosition(100.0f, 100.0f, 100.0f); + animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR); + + tet_infoline( "Animation Progress notification set to 50%" ); + DevelAnimation::SetProgressNotification( animation, 0.5f ); + + application.SendNotification(); + application.Render( ); + + progressCheck.CheckSignalNotReceived(); + + animation.Play(); + + for(int count = 0; count < 4; count++) + { + application.SendNotification(); + application.Render(0); // start animation + progressCheck.CheckSignalNotReceived(); + + application.SendNotification(); + application.Render(durationSeconds*0.25*1000.0f ); // 25% progress + DALI_TEST_EQUALS( 0.75f, animation.GetCurrentProgress(), TEST_LOCATION ); + + tet_infoline( "Animation at 25%" ); + + progressCheck.CheckSignalNotReceived(); + + application.SendNotification(); + application.Render(durationSeconds*0.25*1000.0f ); // 50% progress + application.SendNotification(); + tet_infoline( "Animation at 50%" ); + DALI_TEST_EQUALS( 0.5f, animation.GetCurrentProgress(), TEST_LOCATION ); + + progressCheck.CheckSignalReceived(); + + tet_infoline( "Progress check reset" ); + progressCheck.Reset(); + + application.Render(durationSeconds*0.25*1000.0f ); // 75% progress + tet_infoline( "Animation at 75%" ); + application.SendNotification(); + + DALI_TEST_EQUALS( 0.25f, animation.GetCurrentProgress(), TEST_LOCATION ); + + progressCheck.CheckSignalNotReceived(); + + application.Render(durationSeconds*0.25*1000.0f ); // 100% progress + tet_infoline( "Animation at 100%" ); + application.SendNotification(); + + //Nothing check at 100% progress. cause It can be both 100% and 0%. + finishCheck.CheckSignalNotReceived(); + application.SendNotification(); + } + finishCheck.CheckSignalNotReceived(); + + animation.Stop(); + animation.SetLooping( false ); + animation.SetLoopCount( 4 ); + animation.Play(); + application.Render(0u); + application.SendNotification(); + + for(int count = 0; count < 4; count++) + { + application.SendNotification(); + application.Render(0); // start animation + progressCheck.CheckSignalNotReceived(); + + application.SendNotification(); + application.Render(durationSeconds*0.25*1000.0f ); // 25% progress + DALI_TEST_EQUALS( 0.75f, animation.GetCurrentProgress(), TEST_LOCATION ); + + tet_infoline( "Animation at 25%" ); + + progressCheck.CheckSignalNotReceived(); + + application.SendNotification(); + application.Render(durationSeconds*0.25*1000.0f ); // 50% progress + application.SendNotification(); + tet_infoline( "Animation at 50%" ); + DALI_TEST_EQUALS( 0.5f, animation.GetCurrentProgress(), TEST_LOCATION ); + + progressCheck.CheckSignalReceived(); + + tet_infoline( "Progress check reset" ); + progressCheck.Reset(); + + application.Render(durationSeconds*0.25*1000.0f ); // 75% progress + tet_infoline( "Animation at 75%" ); + application.SendNotification(); + + DALI_TEST_EQUALS( 0.25f, animation.GetCurrentProgress(), TEST_LOCATION ); + + progressCheck.CheckSignalNotReceived(); + + application.Render(durationSeconds*0.25*1000.0f ); // 100% progress + tet_infoline( "Animation at 100%" ); + application.SendNotification(); + + //Nothing check at 100% progress. cause It can be both 100% and 0%. + application.SendNotification(); + } + application.Render(10u); + application.SendNotification(); + application.Render(0u); + application.SendNotification(); + + finishCheck.CheckSignalReceived(); + + END_TEST; +} + +int UtcDaliAnimationProgressCallbackInvalidSignalN(void) +{ + TestApplication application; + + Actor actor = Actor::New(); + Stage::GetCurrent().Add(actor); + + // Build the animation + Animation animation = Animation::New(0.0f); + + //Set duration + const float durationSeconds(1.0f); + animation.SetDuration(durationSeconds); + + bool finishedSignalReceived(false); + bool progressSignalReceived(false); + + AnimationFinishCheck finishCheck(finishedSignalReceived); + animation.FinishedSignal().Connect(&application, finishCheck); + + AnimationProgressCheck progressCheck(progressSignalReceived); + DevelAnimation::ProgressReachedSignal( animation ).Connect( &application, progressCheck); + application.SendNotification(); + + Vector3 targetPosition(100.0f, 100.0f, 100.0f); + animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR); + + tet_infoline( "Animation Progress PlayRange as 10% ~ 90%" ); + animation.SetPlayRange( Vector2( 0.1f, 0.9f ) ); + + tet_infoline( "Animation Progress notification set to >90% that never can notificated" ); + DevelAnimation::SetProgressNotification( animation, 0.9f + Math::MACHINE_EPSILON_1 ); + + application.SendNotification(); + application.Render( ); + + progressCheck.CheckSignalNotReceived(); + + animation.Play(); + + application.SendNotification(); + application.Render(0); // start animation + application.Render(durationSeconds*0.25*1000.0f ); // 35% progress + DALI_TEST_EQUALS( 0.35f, animation.GetCurrentProgress(), TEST_LOCATION ); + + tet_infoline( "Animation at 35%" ); + + progressCheck.CheckSignalNotReceived(); + + application.SendNotification(); + application.Render(durationSeconds*0.25*1000.0f ); // 60% progress + application.SendNotification(); + DALI_TEST_EQUALS( 0.6f, animation.GetCurrentProgress(), TEST_LOCATION ); + + tet_infoline( "Animation at 60%" ); + + progressCheck.CheckSignalNotReceived(); + + application.Render(durationSeconds*0.25*1000.0f ); // 85% progress + tet_infoline( "Animation at 85%" ); + application.SendNotification(); + DALI_TEST_EQUALS( 0.85f, animation.GetCurrentProgress(), TEST_LOCATION ); + + progressCheck.CheckSignalNotReceived(); + + application.Render(durationSeconds*0.25*1000.0f ); // 90% progress + tet_infoline( "Animation over 90%" ); + application.SendNotification(); + + // progress never signaled because playrange is 90% + progressCheck.CheckSignalNotReceived(); + + END_TEST; +} + +int UtcDaliAnimationProgressCallbackLongDurationP(void) +{ + TestApplication application; + + Actor actor = Actor::New(); + Stage::GetCurrent().Add(actor); + + // Build the animation + Animation animation = Animation::New(0.0f); + + //Set duration + float durationSeconds(5.0f); + animation.SetDuration(durationSeconds); + + bool finishedSignalReceived(false); + bool progressSignalReceived(false); + + AnimationFinishCheck finishCheck(finishedSignalReceived); + animation.FinishedSignal().Connect(&application, finishCheck); + + AnimationProgressCheck progressCheck(progressSignalReceived); + DevelAnimation::ProgressReachedSignal( animation ).Connect( &application, progressCheck); + application.SendNotification(); + + Vector3 targetPosition(100.0f, 100.0f, 100.0f); + animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR); + + tet_infoline( "Animation Progress notification set to 50%" ); + DevelAnimation::SetProgressNotification( animation, 0.5f ); + + application.SendNotification(); + application.Render( ); + + progressCheck.CheckSignalNotReceived(); + + animation.Play(); + + application.SendNotification(); + application.Render(0); // start animation + application.Render(durationSeconds*0.25*1000.0f ); // 25% progress + DALI_TEST_EQUALS( 0.25f, animation.GetCurrentProgress(), TEST_LOCATION ); + + tet_infoline( "Animation at 25%" ); + + progressCheck.CheckSignalNotReceived(); + + application.SendNotification(); + application.Render(durationSeconds*0.25*1000.0f ); // 50% progress + application.SendNotification(); + tet_infoline( "Animation at 50%" ); + DALI_TEST_EQUALS( 0.5f, animation.GetCurrentProgress(), TEST_LOCATION ); + + progressCheck.CheckSignalReceived(); + + tet_infoline( "Progress check reset" ); + progressCheck.Reset(); + + application.Render(durationSeconds*0.25*1000.0f ); // 75% progress + tet_infoline( "Animation at 75%" ); + application.SendNotification(); + + DALI_TEST_EQUALS( 0.75f, animation.GetCurrentProgress(), TEST_LOCATION ); + + progressCheck.CheckSignalNotReceived(); + + END_TEST; +} + +int UtcDaliAnimationAnimateByInvalidParameters(void) +{ + TestApplication application; + + Actor actor = Actor::New(); + Stage::GetCurrent().Add(actor); + + // Create the animation + Animation animation = Animation::New(1.0f); + + DALI_TEST_ASSERTION( + { + // non animateable property (STRING) + animation.AnimateBy( Property( actor, Actor::Property::LAYOUT_DIRECTION ), Property::Value( "new direction" ) ); + }, "Property type is not animatable" ); + + DALI_TEST_ASSERTION( + { + // non animateable property (MATRIX) + Property::Index index = actor.RegisterProperty( "Foobar", Property::Value( Dali::Matrix() ), Property::ANIMATABLE ); + animation.AnimateBy( Property( actor, index ), Property::Value( Property::MATRIX ) ); + }, "Property type is not animatable" ); + + // AnimateBy + DALI_TEST_ASSERTION( + { + // non animateable target (NONE) + animation.AnimateBy( Property( actor, Actor::Property::POSITION ), Property::Value() ); + }, "Target value is not animatable" ); + + DALI_TEST_ASSERTION( + { + // non animateable target (STRING) + animation.AnimateBy( Property( actor, Actor::Property::POSITION ), Property::Value("foo") ); + }, "Target value is not animatable" ); + + DALI_TEST_ASSERTION( + { + // not mathing properties (VECTOR3, FLOAT) + animation.AnimateBy( Property( actor, Actor::Property::POSITION ), Property::Value( 10.f ) ); + }, "Property and target types don't match" ); + + DALI_TEST_ASSERTION( + { + // not mathing properties (VECTOR3.A, VECTOR2) + animation.AnimateBy( Property( actor, Actor::Property::COLOR_ALPHA ), Property::Value( Property::VECTOR2 ) ); + }, "Property and target types don't match" ); + + DALI_TEST_ASSERTION( + { + // negative duration + animation.AnimateBy( Property( actor, Actor::Property::POSITION ), Property::Value( Vector3(1,2,3) ), TimePeriod(-1) ); + }, "Duration must be >=0" ); + + END_TEST; +} + +int UtcDaliAnimationAnimateToInvalidParameters(void) +{ + TestApplication application; + + Actor actor = Actor::New(); + Stage::GetCurrent().Add(actor); + + // Create the animation + Animation animation = Animation::New(1.0f); + + // AnimateTo + DALI_TEST_ASSERTION( + { + // non animateable property (MAP) + Property::Index index = actor.RegisterProperty( "Foobar", Property::Value( Property::MAP ), Property::ANIMATABLE ); + animation.AnimateTo( Property( actor, index ), Property::Value( Property::MAP ) ); + }, "Property type is not animatable" ); + + DALI_TEST_ASSERTION( + { + // non animateable target (NONE) + animation.AnimateTo( Property( actor, Actor::Property::CLIPPING_MODE ), Property::Value() ); + }, "Property type is not animatable" ); + + DALI_TEST_ASSERTION( + { + // non animateable target (ARRAY) + animation.AnimateTo( Property( actor, Actor::Property::POSITION ), Property::Value( Property::ARRAY ) ); + }, "Target value is not animatable" ); + + DALI_TEST_ASSERTION( + { + // non animateable target (RECTANGLE) + animation.AnimateBy( Property( actor, Actor::Property::POSITION ), Property::Value( Rect() ) ); + }, "Target value is not animatable" ); + + DALI_TEST_ASSERTION( + { + // not mathing properties (FLOAT, INT) + animation.AnimateTo( Property( actor, Actor::Property::SCALE_Y ), Property::Value(10) ); + }, "Property and target types don't match" ); + + DALI_TEST_ASSERTION( + { + // not mathing properties (VECTOR3, VECTOR2) + animation.AnimateTo( Property( actor, Actor::Property::COLOR ), Property::Value( Property::VECTOR2 ) ); + }, "Property and target types don't match" ); + + DALI_TEST_ASSERTION( + { + // negative duration + animation.AnimateTo( Property( actor, Actor::Property::POSITION ), Property::Value( Vector3(1,2,3) ), TimePeriod(-1) ); + }, "Duration must be >=0" ); + + END_TEST; +} + +int UtcDaliAnimationAnimateBetweenInvalidParameters(void) +{ + TestApplication application; + + Actor actor = Actor::New(); + Stage::GetCurrent().Add(actor); + + // Create the animation + Animation animation = Animation::New(1.0f); + + // AnimateBetween + DALI_TEST_ASSERTION( + { + // non animateable property (ARRAY) + Property::Index index = actor.RegisterProperty( "Foobar", Property::Value( Property::ARRAY ), Property::ANIMATABLE ); + KeyFrames keyframes = KeyFrames::New(); + keyframes.Add( 0.5f, Property::Value( Property::ARRAY ) ); + animation.AnimateBetween( Property( actor, index ), keyframes ); + }, "Property type is not animatable" ); + + DALI_TEST_ASSERTION( + { + // non animateable target (NONE) + KeyFrames keyframes = KeyFrames::New(); + keyframes.Add( 0.5f, Property::Value() ); + animation.AnimateBetween( Property( actor, Actor::Property::CLIPPING_MODE ), keyframes ); + }, "Property type is not animatable" ); + + DALI_TEST_ASSERTION( + { + // non animateable target (EXTENTS) + KeyFrames keyframes = KeyFrames::New(); + keyframes.Add( 0.5f, Property::Value( Property::EXTENTS ) ); // throws + animation.AnimateBetween( Property( actor, Actor::Property::POSITION ), keyframes ); + }, "Property type is not animatable" ); + + DALI_TEST_ASSERTION( + { + // non animateable target (RECTANGLE) + KeyFrames keyframes = KeyFrames::New(); + keyframes.Add( 0.5f, Property::Value( Property::MAP ) ); // throws + animation.AnimateBetween( Property( actor, Actor::Property::POSITION ), keyframes ); + }, "Property type is not animatable" ); + + DALI_TEST_ASSERTION( + { + // not mathing properties (VECTOR2, VECTOR4) + KeyFrames keyframes = KeyFrames::New(); + keyframes.Add( 0.5f, Property::Value( Vector4( 1, 2, 3, 4 ) ) ); + animation.AnimateBetween( Property( actor, Actor::Property::MAXIMUM_SIZE ), keyframes ); + }, "Property and target types don't match" ); + + DALI_TEST_ASSERTION( + { + // negative duration + KeyFrames keyframes = KeyFrames::New(); + keyframes.Add( 0.5f, Property::Value(Vector3( 1, 2, 3 ) ) ); + animation.AnimateBetween( Property( actor, Actor::Property::POSITION ), keyframes, TimePeriod(-1) ); + }, "Duration must be >=0" ); + + END_TEST; +} + +namespace // Purposefully left this in the middle as the values in this namespace are only used for the subsequent two test cases +{ +enum TestFunction +{ + STOP, + CLEAR +}; + +void CheckPropertyValuesWhenCallingAnimationMethod( TestFunction functionToTest, const char * testName ) +{ + tet_printf( "Testing %s\n", testName ); + + // When an Animation::Stop() or Animation::Clear() is called, the event-side property needs to be updated appropriately + // This test checks that that is being done + + const float durationSeconds( 1.0f ); + unsigned int halfAnimationDuration( static_cast< unsigned int >( durationSeconds * 1000.0f * 0.5f ) ); + const Vector3 originalPosition( Vector3::ZERO ); + const Vector3 targetPosition( 10.0f, 10.0f, 10.0f ); + const Vector3 halfWayToTarget( targetPosition * 0.5f ); + + struct ExpectedValue + { + Animation::EndAction endAction; + Vector3 expectedGetPropertyValue; + }; + + ExpectedValue expectedValueTable[] = + { + { Animation::Bake, halfWayToTarget }, // When baking, the current value is the final value. + { Animation::BakeFinal, targetPosition }, // When BakeFinal, we should jump to the final value when clearing or stopping. + { Animation::Discard, originalPosition }, // When discarding, we should jump back to the original value when clearing or stopping. + }; + const auto expectedValueTableCount = sizeof( expectedValueTable ) / sizeof( ExpectedValue ); + + for( auto i = 0u; i < expectedValueTableCount; ++i ) + { + TestApplication application; + + Actor actor = Actor::New(); + Stage::GetCurrent().Add(actor); + + // Build the animation + Animation animation = Animation::New( durationSeconds ); + animation.SetEndAction( expectedValueTable[ i ].endAction ); + animation.AnimateTo( Property( actor, Actor::Property::POSITION ), targetPosition, AlphaFunction::LINEAR ); + + // Start the animation + animation.Play(); + + application.SendNotification(); + application.Render( halfAnimationDuration ); + + // Stop or Clear the animation early, both have the same effect + if( functionToTest == TestFunction::STOP ) + { + animation.Stop(); + } + else + { + animation.Clear(); + } + + // The event side property should be set the expected value immediately, the update side property will still only be halfway as we haven't run an update yet + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::POSITION ).Get< Vector3 >(), expectedValueTable[ i ].expectedGetPropertyValue, VECTOR3_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty( Actor::Property::POSITION ).Get< Vector3 >(), halfWayToTarget, VECTOR3_EPSILON, TEST_LOCATION ); + + // After one frame, both values should match regardless of the End Action + application.SendNotification(); + application.Render(); + + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::POSITION ).Get< Vector3 >(), expectedValueTable[ i ].expectedGetPropertyValue, VECTOR3_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty( Actor::Property::POSITION ).Get< Vector3 >(), expectedValueTable[ i ].expectedGetPropertyValue, VECTOR3_EPSILON, TEST_LOCATION ); + } +} +} // unnamed namespace + +int UtcDaliAnimationStopPropertyValue(void) +{ + CheckPropertyValuesWhenCallingAnimationMethod( TestFunction::STOP, "UtcDaliAnimationStopPropertyValue" ); + END_TEST; +} + +int UtcDaliAnimationClearPropertyValue(void) +{ + CheckPropertyValuesWhenCallingAnimationMethod( TestFunction::CLEAR, "UtcDaliAnimationStopPropertyValue" ); + END_TEST; +} + +int UtcDaliAnimationPausePropertyValue(void) +{ + const float durationSeconds( 1.0f ); + unsigned int halfAnimationDuration( static_cast< unsigned int >( durationSeconds * 1000.0f * 0.5f ) ); + const Vector3 originalPosition( Vector3::ZERO ); + const Vector3 targetPosition( 10.0f, 10.0f, 10.0f ); + const Vector3 halfWayToTarget( targetPosition * 0.5f ); + + Animation::EndAction endActions[] = + { + Animation::Bake, + Animation::BakeFinal, + Animation::Discard, + }; + const auto endActionCount = sizeof( endActions ) / sizeof( endActions[0] ); + + // For all end actions, when pausing, we stay at the current value + for( auto i = 0u; i < endActionCount; ++i ) + { + TestApplication application; + + Actor actor = Actor::New(); + Stage::GetCurrent().Add(actor); + + // Build the animation + Animation animation = Animation::New( durationSeconds ); + animation.SetEndAction( endActions[ i ] ); + animation.AnimateTo( Property( actor, Actor::Property::POSITION ), targetPosition, AlphaFunction::LINEAR ); + + // Start the animation + animation.Play(); + + application.SendNotification(); + application.Render( halfAnimationDuration ); + + // Puase the animation early + animation.Pause(); + + // The event side property should be set the current value immediately, the update side property will still only be halfway + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::POSITION ).Get< Vector3 >(), halfWayToTarget, VECTOR3_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty( Actor::Property::POSITION ).Get< Vector3 >(), halfWayToTarget, VECTOR3_EPSILON, TEST_LOCATION ); + + // After one frame, both values should match regardless of the End Action + application.SendNotification(); + application.Render(); + + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::POSITION ).Get< Vector3 >(), halfWayToTarget, VECTOR3_EPSILON, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty( Actor::Property::POSITION ).Get< Vector3 >(), halfWayToTarget, VECTOR3_EPSILON, TEST_LOCATION ); + } + + END_TEST; +} + +int UtcDaliAnimationPlayFromWithLoopCount(void) +{ + TestApplication application; + + auto actor = Actor::New(); + Stage::GetCurrent().Add( actor ); + + auto animation = Animation::New( 1.0f ); + animation.AnimateTo( Property( actor, Actor::Property::POSITION_X ), 100.0f ); + animation.SetLoopCount( 2 ); + animation.Play(); + + application.SendNotification(); + application.Render( 1001 ); + + // One loop completed + + application.Render( 2005 ); + application.SendNotification(); + + // 2 loops should have completed + DALI_TEST_EQUALS( animation.GetCurrentLoop(), 2u, TEST_LOCATION ); + + // Another render needs to occur after all the loops end + application.SendNotification(); + application.Render( 1000 ); + + // Stop the animation and use PlayFrom, previously we got an Assert here + animation.Stop(); + animation.PlayFrom( 0.5f ); + + application.SendNotification(); + application.Render( 1000 ); + + DALI_TEST_EQUALS( animation.GetState(), Animation::PLAYING, TEST_LOCATION ); + + END_TEST; +} + +int UtcDaliAnimationCombineToAndByWithStop(void) +{ + tet_infoline( "Ensure the Y Position is not modified when animating the X position using AnimateTo and AnimateBy"); + + TestApplication application; + + auto actor = Actor::New(); + actor.SetPosition( 100.0f, 100.0f ); + Stage::GetCurrent().Add( actor ); + + auto animation = Animation::New( 1.0f ); + const float origY = actor.GetProperty( Actor::Property::POSITION_Y ).Get< float >(); + animation.AnimateTo( Property( actor, Actor::Property::POSITION ), Vector3( 150.0f, origY, 0.0f ), TimePeriod( 1.0f ) ); + animation.AnimateBy( Property( actor, Actor::Property::POSITION ), Vector3( -30.0f, 0.0f, 0.0f ), TimePeriod( 1.0f, 1.0f ) ); + animation.Play(); + + application.SendNotification(); + application.Render( 500 ); + + application.SendNotification(); + application.Render( 500 ); + + application.SendNotification(); + application.Render( 500 ); + + // Stop and clear the animation using the current values + animation.Stop(); + animation.Clear(); + + // Check the y position, it should be the same as before + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::POSITION_Y).Get< float >(), origY, TEST_LOCATION ); + + END_TEST; +} + +int UtcDaliAnimationCountAndGetAnimationAt(void) +{ + tet_infoline( "UtcDaliAnimationCountAndGetAnimationAt"); + + TestApplication application; + + auto actor = Actor::New(); + actor.SetPosition( 100.0f, 100.0f ); + Stage::GetCurrent().Add( actor ); + + auto animation = Animation::New( 1.0f ); + const float origY = actor.GetProperty( Actor::Property::POSITION_Y ).Get< float >(); + animation.AnimateTo( Property( actor, Actor::Property::POSITION ), Vector3( 150.0f, origY, 0.0f ), TimePeriod( 1.0f ) ); + animation.Play(); + + application.SendNotification(); + application.Render( 500 ); + + uint32_t animationCount = Dali::DevelAnimation::GetAnimationCount(); + DALI_TEST_EQUALS( animationCount, 1, TEST_LOCATION ); + + DALI_TEST_CHECK( !Dali::DevelAnimation::GetAnimationAt( 5 ) ); + + Dali::Animation animationReturned = Dali::DevelAnimation::GetAnimationAt( 0 ); + DALI_TEST_EQUALS( animationReturned.GetState(), Dali::Animation::State::PLAYING, TEST_LOCATION ); + + DALI_TEST_EQUALS( animation.GetDuration(), animationReturned.GetDuration(), TEST_LOCATION ); + DALI_TEST_EQUALS( animation.GetLoopCount(), animationReturned.GetLoopCount(), TEST_LOCATION ); + DALI_TEST_EQUALS( animation.IsLooping(), animationReturned.IsLooping(), TEST_LOCATION ); + DALI_TEST_EQUALS( animation.GetEndAction(), animationReturned.GetEndAction(), TEST_LOCATION ); + DALI_TEST_EQUALS( animation.GetState(), animationReturned.GetState(), TEST_LOCATION ); + + // Stop and clear the animation using the current values + animation.Stop(); + animation.Clear(); + END_TEST; }