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);
- }
+ }, "IsPropertyAnimatable( index )" );
+
END_TEST;
}
-int UtcDaliAnimationAnimateToActorParentOriginXP(void)
+int UtcDaliAnimationAnimateToActorParentOriginXN(void)
{
TestApplication application;
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);
- }
+ }, "IsPropertyAnimatable( index )" );
+
END_TEST;
}
-int UtcDaliAnimationAnimateToActorParentOriginYP(void)
+int UtcDaliAnimationAnimateToActorParentOriginYN(void)
{
TestApplication application;
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);
- }
+ }, "IsPropertyAnimatable( index )" );
+
END_TEST;
}
-int UtcDaliAnimationAnimateToActorParentOriginZP(void)
+int UtcDaliAnimationAnimateToActorParentOriginZN(void)
{
TestApplication application;
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);
- }
+ }, "IsPropertyAnimatable( index )" );
+
END_TEST;
}
-int UtcDaliAnimationAnimateToActorAnchorPointP(void)
+int UtcDaliAnimationAnimateToActorAnchorPointN(void)
{
TestApplication application;
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);
- }
+ }, "IsPropertyAnimatable( index )" );
+
END_TEST;
}
-int UtcDaliAnimationAnimateToActorAnchorPointXP(void)
+int UtcDaliAnimationAnimateToActorAnchorPointXN(void)
{
TestApplication application;
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);
- }
+ }, "IsPropertyAnimatable( index )" );
+
END_TEST;
}
-int UtcDaliAnimationAnimateToActorAnchorPointYP(void)
+int UtcDaliAnimationAnimateToActorAnchorPointYN(void)
{
TestApplication application;
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);
- }
+ }, "IsPropertyAnimatable( index )" );
+
END_TEST;
}
-int UtcDaliAnimationAnimateToActorAnchorPointZP(void)
+int UtcDaliAnimationAnimateToActorAnchorPointZN(void)
{
TestApplication application;
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);
- }
+ }, "IsPropertyAnimatable( index )" );
+
END_TEST;
}
END_TEST;
}
-int UtcDaliAnimationKeyFrames02P(void)
+int UtcDaliAnimationKeyFrames02N(void)
{
TestApplication application;
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;
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;
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;
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;
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;
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;
}
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<int>(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;
}
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<int>(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;
}
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<int>(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
-
- tet_result(TET_FAIL);
- }
- catch ( Dali::DaliException& e )
- {
- DALI_TEST_ASSERT( e, "Type not animateable", TEST_LOCATION );
- }
+ }, "Property type is not animatable" );
END_TEST;
}
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<unsigned int>(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" );
Animation animation = Animation::New(0.0f);
//Set duration
- float durationSeconds(1.0f);
+ const float durationSeconds(1.0f);
animation.SetDuration(durationSeconds);
// Set Looping Count
- int loopCount( 4 );
+ const int loopCount( 4 );
animation.SetLoopCount( loopCount );
bool finishedSignalReceived(false);
Animation animation = Animation::New(0.0f);
//Set duration
- float durationSeconds(1.0f);
+ const float durationSeconds(1.0f);
animation.SetDuration(durationSeconds);
// Set Looping Unlmited
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;
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<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;
+}