+
+int UtcDaliAnimationAnimateByInvalidParameters(void)
+{
+ TestApplication application;
+
+ Actor actor = Actor::New();
+ application.GetScene().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();
+ application.GetScene().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<int32_t>()));
+ },
+ "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();
+ application.GetScene().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::BAKE_FINAL, 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();
+ application.GetScene().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 UtcDaliAnimationClearPropertyValue01(void)
+{
+ CheckPropertyValuesWhenCallingAnimationMethod(TestFunction::CLEAR, "UtcDaliAnimationStopPropertyValue");
+ END_TEST;
+}
+
+int UtcDaliAnimationClearPropertyValue02(void)
+{
+ TestApplication application;
+
+ Actor actor = Actor::New();
+ application.GetScene().Add(actor);
+
+ const float durationSeconds(1.0f);
+ const Vector3 targetPosition1(10.0f, 10.0f, 10.0f);
+ const Vector3 targetPosition2(20.0f, 20.0f, 20.0f);
+
+ // Build the animation
+ Animation animation1 = Animation::New(durationSeconds);
+ animation1.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition1, AlphaFunction::LINEAR);
+ animation1.Play();
+
+ application.SendNotification();
+ application.Render(static_cast<unsigned int>(durationSeconds * 1000.0f) - 1u /*just less than the animation duration*/);
+
+ // The event side property should be set the current value immediately
+ DALI_TEST_EQUALS(actor.GetProperty(Actor::Property::POSITION).Get<Vector3>(), targetPosition1, VECTOR3_EPSILON, TEST_LOCATION);
+
+ application.SendNotification();
+ application.Render(2u /*just beyond the animation duration*/);
+
+ // Build a new animation
+ Animation animation2 = Animation::New(durationSeconds);
+ animation2.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition2, AlphaFunction::LINEAR);
+ animation2.Play();
+
+ application.SendNotification();
+ application.Render(static_cast<unsigned int>(durationSeconds * 1000.0f) - 1u /*just less than the animation duration*/);
+
+ // The event side property should be set the current value immediately
+ DALI_TEST_EQUALS(actor.GetProperty(Actor::Property::POSITION).Get<Vector3>(), targetPosition2, VECTOR3_EPSILON, TEST_LOCATION);
+
+ // Clear the first animation after finished
+ animation1.Clear();
+
+ application.SendNotification();
+ application.Render(static_cast<unsigned int>(durationSeconds * 1000.0f) - 1u /*just less than the animation duration*/);
+
+ // The property should not be changed.
+ DALI_TEST_EQUALS(actor.GetProperty(Actor::Property::POSITION).Get<Vector3>(), targetPosition2, VECTOR3_EPSILON, TEST_LOCATION);
+
+ END_TEST;
+}
+
+int UtcDaliAnimationPausePropertyValue(void)
+{
+ const float durationSeconds(1.0f);
+ unsigned int halfAnimationDuration(static_cast<unsigned int>(durationSeconds * 1000.0f * 0.5f));
+ const Vector3 targetPosition(10.0f, 10.0f, 10.0f);
+ const Vector3 halfWayToTarget(targetPosition * 0.5f);
+
+ Animation::EndAction endActions[] =
+ {
+ Animation::BAKE,
+ Animation::BAKE_FINAL,
+ 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();
+ application.GetScene().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();
+ application.GetScene().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.SetProperty(Actor::Property::POSITION, Vector2(100.0f, 100.0f));
+ application.GetScene().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.SetProperty(Actor::Property::POSITION, Vector2(100.0f, 100.0f));
+ application.GetScene().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;
+}
+
+int UtcDaliAnimationSetLoopingNegative(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ try
+ {
+ bool arg1(false);
+ instance.SetLooping(arg1);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationSetDurationNegative(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ try
+ {
+ float arg1(0.0f);
+ instance.SetDuration(arg1);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationGetLoopCountNegative(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ try
+ {
+ instance.GetLoopCount();
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationSetEndActionNegative(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ try
+ {
+ Dali::Animation::EndAction arg1(Animation::BAKE);
+ instance.SetEndAction(arg1);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationSetLoopCountNegative(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ try
+ {
+ int arg1(0);
+ instance.SetLoopCount(arg1);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationSetPlayRangeNegative(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ try
+ {
+ Dali::Vector2 arg1;
+ instance.SetPlayRange(arg1);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationAnimateBetweenNegative01(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ Dali::Actor actor;
+ try
+ {
+ Dali::Property arg1(actor, Actor::Property::POSITION);
+ Dali::KeyFrames arg2;
+ instance.AnimateBetween(arg1, arg2);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationAnimateBetweenNegative02(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ Dali::Actor actor;
+ try
+ {
+ Dali::Property arg1(actor, Actor::Property::POSITION);
+ Dali::KeyFrames arg2;
+ Dali::Animation::Interpolation arg3(Animation::LINEAR);
+ instance.AnimateBetween(arg1, arg2, arg3);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationAnimateBetweenNegative03(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ Dali::Actor actor;
+ try
+ {
+ Dali::Property arg1(actor, Actor::Property::POSITION);
+ Dali::KeyFrames arg2;
+ Dali::TimePeriod arg3(1.0f);
+ instance.AnimateBetween(arg1, arg2, arg3);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationAnimateBetweenNegative04(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ Dali::Actor actor;
+ try
+ {
+ Dali::Property arg1(actor, Actor::Property::POSITION);
+ Dali::KeyFrames arg2;
+ Dali::TimePeriod arg3(1.0f);
+ Dali::Animation::Interpolation arg4(Animation::LINEAR);
+ instance.AnimateBetween(arg1, arg2, arg3, arg4);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationAnimateBetweenNegative05(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ Dali::Actor actor;
+ try
+ {
+ Dali::Property arg1(actor, Actor::Property::POSITION);
+ Dali::KeyFrames arg2;
+ Dali::AlphaFunction arg3;
+ instance.AnimateBetween(arg1, arg2, arg3);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationAnimateBetweenNegative06(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ Dali::Actor actor;
+ try
+ {
+ Dali::Property arg1(actor, Actor::Property::POSITION);
+ Dali::KeyFrames arg2;
+ Dali::AlphaFunction arg3;
+ Dali::Animation::Interpolation arg4(Animation::LINEAR);
+ instance.AnimateBetween(arg1, arg2, arg3, arg4);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationAnimateBetweenNegative07(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ Dali::Actor actor;
+ try
+ {
+ Dali::Property arg1(actor, Actor::Property::POSITION);
+ Dali::KeyFrames arg2;
+ Dali::AlphaFunction arg3;
+ Dali::TimePeriod arg4(1.0f);
+ instance.AnimateBetween(arg1, arg2, arg3, arg4);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationAnimateBetweenNegative08(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ Dali::Actor actor;
+ try
+ {
+ Dali::Property arg1(actor, Actor::Property::POSITION);
+ Dali::KeyFrames arg2;
+ Dali::AlphaFunction arg3;
+ Dali::TimePeriod arg4(1.0f);
+ Dali::Animation::Interpolation arg5(Animation::LINEAR);
+ instance.AnimateBetween(arg1, arg2, arg3, arg4, arg5);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationFinishedSignalNegative(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ try
+ {
+ instance.FinishedSignal();
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationGetCurrentLoopNegative(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ try
+ {
+ instance.GetCurrentLoop();
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationSetLoopingModeNegative(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ try
+ {
+ Dali::Animation::LoopingMode arg1(Animation::RESTART);
+ instance.SetLoopingMode(arg1);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationSetSpeedFactorNegative(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ try
+ {
+ float arg1(0.0f);
+ instance.SetSpeedFactor(arg1);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationGetCurrentProgressNegative(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ try
+ {
+ instance.GetCurrentProgress();
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationSetCurrentProgressNegative(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ try
+ {
+ float arg1(0.0f);
+ instance.SetCurrentProgress(arg1);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationSetDisconnectActionNegative(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ try
+ {
+ Dali::Animation::EndAction arg1(Animation::BAKE);
+ instance.SetDisconnectAction(arg1);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationSetDefaultAlphaFunctionNegative(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ try
+ {
+ Dali::AlphaFunction arg1;
+ instance.SetDefaultAlphaFunction(arg1);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationHideNegative(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ try
+ {
+ Dali::Actor arg1;
+ float arg2(0.0f);
+ instance.Hide(arg1, arg2);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationPlayNegative(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ try
+ {
+ instance.Play();
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationShowNegative(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ try
+ {
+ Dali::Actor arg1;
+ float arg2(0.0f);
+ instance.Show(arg1, arg2);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationStopNegative(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ try
+ {
+ instance.Stop();
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationClearNegative(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ try
+ {
+ instance.Clear();
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationPauseNegative(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ try
+ {
+ instance.Pause();
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationAnimateNegative01(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ try
+ {
+ Dali::Actor arg1;
+ Dali::Path arg2;
+ Dali::Vector3 arg3;
+ instance.Animate(arg1, arg2, arg3);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationAnimateNegative02(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ try
+ {
+ Dali::Actor arg1;
+ Dali::Path arg2;
+ Dali::Vector3 arg3;
+ Dali::TimePeriod arg4(1.0f);
+ instance.Animate(arg1, arg2, arg3, arg4);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationAnimateNegative03(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ try
+ {
+ Dali::Actor arg1;
+ Dali::Path arg2;
+ Dali::Vector3 arg3;
+ Dali::AlphaFunction arg4;
+ instance.Animate(arg1, arg2, arg3, arg4);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationAnimateNegative04(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ try
+ {
+ Dali::Actor arg1;
+ Dali::Path arg2;
+ Dali::Vector3 arg3;
+ Dali::AlphaFunction arg4;
+ Dali::TimePeriod arg5(1.0f);
+ instance.Animate(arg1, arg2, arg3, arg4, arg5);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationPlayFromNegative(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ try
+ {
+ float arg1(0.0f);
+ instance.PlayFrom(arg1);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationAnimateByNegative01(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ Dali::Actor actor;
+ try
+ {
+ Dali::Property arg1(actor, Actor::Property::POSITION);
+ Dali::Property::Value arg2;
+ instance.AnimateBy(arg1, arg2);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationAnimateByNegative02(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ Dali::Actor actor;
+ try
+ {
+ Dali::Property arg1(actor, Actor::Property::POSITION);
+ Dali::Property::Value arg2;
+ Dali::TimePeriod arg3(1.0f);
+ instance.AnimateBy(arg1, arg2, arg3);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationAnimateByNegative03(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ Dali::Actor actor;
+ try
+ {
+ Dali::Property arg1(actor, Actor::Property::POSITION);
+ Dali::Property::Value arg2;
+ Dali::AlphaFunction arg3;
+ instance.AnimateBy(arg1, arg2, arg3);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationAnimateByNegative04(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ Dali::Actor actor;
+ try
+ {
+ Dali::Property arg1(actor, Actor::Property::POSITION);
+ Dali::Property::Value arg2;
+ Dali::AlphaFunction arg3;
+ Dali::TimePeriod arg4(1.0f);
+ instance.AnimateBy(arg1, arg2, arg3, arg4);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationAnimateToNegative01(void)
+{
+ TestApplication application;
+ Dali::Actor actor;
+ Dali::Animation instance;
+ try
+ {
+ Dali::Property arg1(actor, Actor::Property::POSITION);
+ Dali::Property::Value arg2;
+ instance.AnimateTo(arg1, arg2);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationAnimateToNegative02(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ Dali::Actor actor;
+ try
+ {
+ Dali::Property arg1(actor, Actor::Property::POSITION);
+ Dali::Property::Value arg2;
+ Dali::TimePeriod arg3(1.0f);
+ instance.AnimateTo(arg1, arg2, arg3);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationAnimateToNegative03(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ Dali::Actor actor;
+ try
+ {
+ Dali::Property arg1(actor, Actor::Property::POSITION);
+ Dali::Property::Value arg2;
+ Dali::AlphaFunction arg3;
+ instance.AnimateTo(arg1, arg2, arg3);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationAnimateToNegative04(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ Dali::Actor actor;
+ try
+ {
+ Dali::Property arg1(actor, Actor::Property::POSITION);
+ Dali::Property::Value arg2;
+ Dali::AlphaFunction arg3;
+ Dali::TimePeriod arg4(1.0f);
+ instance.AnimateTo(arg1, arg2, arg3, arg4);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationPlayAfterNegative(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ try
+ {
+ float arg1(0.0f);
+ instance.PlayAfter(arg1);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationGetDurationNegative(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ try
+ {
+ instance.GetDuration();
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationGetEndActionNegative(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ try
+ {
+ instance.GetEndAction();
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationGetPlayRangeNegative(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ try
+ {
+ instance.GetPlayRange();
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationGetLoopingModeNegative(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ try
+ {
+ instance.GetLoopingMode();
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationGetSpeedFactorNegative(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ try
+ {
+ instance.GetSpeedFactor();
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationGetDisconnectActionNegative(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ try
+ {
+ instance.GetDisconnectAction();
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationGetDefaultAlphaFunctionNegative(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ try
+ {
+ instance.GetDefaultAlphaFunction();
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationGetStateNegative(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ try
+ {
+ instance.GetState();
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliAnimationIsLoopingNegative(void)
+{
+ TestApplication application;
+ Dali::Animation instance;
+ try
+ {
+ instance.IsLooping();
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliKeyFramesAddNegative01(void)
+{
+ TestApplication application;
+ Dali::KeyFrames instance;
+ try
+ {
+ float arg1(0.0f);
+ Dali::Property::Value arg2;
+ instance.Add(arg1, arg2);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliKeyFramesAddNegative02(void)
+{
+ TestApplication application;
+ Dali::KeyFrames instance;
+ try
+ {
+ float arg1(0.0f);
+ Dali::Property::Value arg2;
+ Dali::AlphaFunction arg3;
+ instance.Add(arg1, arg2, arg3);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliKeyFramesGetTypeNegative(void)
+{
+ TestApplication application;
+ Dali::KeyFrames instance;
+ try
+ {
+ instance.GetType();
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}