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;
+}
/*
- * Copyright (c) 2018 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.
mState = Playing;
SetAnimatorsActive( true );
+
+ mCurrentLoop = 0;
}
}