diff options
author | Michael Brasser <michael.brasser@jollamobile.com> | 2014-04-06 22:42:29 -0500 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-04-08 01:39:48 +0200 |
commit | b12285bc3d49b0d17751ebaf0853f3642b4b8b29 (patch) | |
tree | 0dd35c84d523077aba85acb4ac6a4456b5854131 /tests/auto/quick/qquicksmoothedanimation | |
parent | 02ad96fa8870630c6b77327098c712d6418b8fda (diff) |
Verify empty SmoothedAnimation doesn't keep animation system running.
Change-Id: I8f8a9d31241e1bff9e72524b69d625258885558a
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Diffstat (limited to 'tests/auto/quick/qquicksmoothedanimation')
-rw-r--r-- | tests/auto/quick/qquicksmoothedanimation/tst_qquicksmoothedanimation.cpp | 22 |
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" |