+
+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<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();
+ 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;
+}