aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/auto/quick/qquicksmoothedanimation/tst_qquicksmoothedanimation.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/quick/qquicksmoothedanimation/tst_qquicksmoothedanimation.cpp b/tests/auto/quick/qquicksmoothedanimation/tst_qquicksmoothedanimation.cpp
index 650ce09dfa..7642583bb1 100644
--- a/tests/auto/quick/qquicksmoothedanimation/tst_qquicksmoothedanimation.cpp
+++ b/tests/auto/quick/qquicksmoothedanimation/tst_qquicksmoothedanimation.cpp
@@ -61,6 +61,7 @@ private slots:
void behavior();
void deleteOnUpdate();
void zeroDuration();
+ void noStart();
private:
QQmlEngine engine;
@@ -263,6 +264,27 @@ void tst_qquicksmoothedanimation::zeroDuration()
delete rect;
}
+//verify that an empty SmoothedAnimation does not fire up the animation system
+//and keep it running forever
+void tst_qquicksmoothedanimation::noStart()
+{
+ QQmlEngine engine;
+ QQmlComponent c(&engine, testFileUrl("smoothedanimation1.qml"));
+ QQuickSmoothedAnimation *obj = qobject_cast<QQuickSmoothedAnimation*>(c.create());
+
+ QVERIFY(obj != 0);
+
+ obj->start();
+ QCOMPARE(obj->isRunning(), false);
+ QTest::qWait(100);
+ QCOMPARE(obj->isRunning(), false);
+ //this could fail if the test is being run in parallel with other tests
+ //or if an earlier test failed and didn't clean up (left an animation running)
+ //QCOMPARE(QUnifiedTimer::instance()->runningAnimationCount(), 0);
+
+ delete obj;
+}
+
QTEST_MAIN(tst_qquicksmoothedanimation)
#include "tst_qquicksmoothedanimation.moc"