From 8d71d12187c9a6ff28793b28d2e092629af14290 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 17 Jan 2013 15:15:37 +0100 Subject: [PATCH] SceneGraph: animationStopped() should be called after duration is exceeded. The test currently fails. --- src/SceneGraph/Test/AnimableTest.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/SceneGraph/Test/AnimableTest.cpp b/src/SceneGraph/Test/AnimableTest.cpp index d824ff4ff..600f815d4 100644 --- a/src/SceneGraph/Test/AnimableTest.cpp +++ b/src/SceneGraph/Test/AnimableTest.cpp @@ -144,11 +144,20 @@ class OneShotAnimable: public SceneGraph::Animable<3> { } GLfloat time; + std::string stateChanges; protected: void animationStep(GLfloat time, GLfloat) override { this->time = time; } + + void animationStarted() override { + stateChanges += "started;"; + } + + void animationStopped() override { + stateChanges += "stopped;"; + } }; void AnimableTest::step() { @@ -199,12 +208,14 @@ void AnimableTest::duration() { running and animationStep() is called */ group.step(1.0f, 0.5f); CORRADE_COMPARE(animable.state(), AnimationState::Running); + CORRADE_COMPARE(animable.stateChanges, "started;"); CORRADE_COMPARE(animable.time, 0.0f); /* Next animation step is out of duration and repeat is not enabled, animationStep() shouldn't be called and animation should be stopped */ group.step(12.75f, 0.5f); CORRADE_COMPARE(animable.state(), AnimationState::Stopped); + CORRADE_COMPARE(animable.stateChanges, "started;stopped;"); CORRADE_COMPARE(animable.time, 0.0f); }