summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativesmoothedanimation/tst_qdeclarativesmoothedanimation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/declarative/qdeclarativesmoothedanimation/tst_qdeclarativesmoothedanimation.cpp')
-rw-r--r--tests/auto/declarative/qdeclarativesmoothedanimation/tst_qdeclarativesmoothedanimation.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativesmoothedanimation/tst_qdeclarativesmoothedanimation.cpp b/tests/auto/declarative/qdeclarativesmoothedanimation/tst_qdeclarativesmoothedanimation.cpp
index 452168a6..1d511779 100644
--- a/tests/auto/declarative/qdeclarativesmoothedanimation/tst_qdeclarativesmoothedanimation.cpp
+++ b/tests/auto/declarative/qdeclarativesmoothedanimation/tst_qdeclarativesmoothedanimation.cpp
@@ -58,6 +58,7 @@ private slots:
void simpleAnimation();
void valueSource();
void behavior();
+ void zeroDuration();
private:
QDeclarativeEngine engine;
@@ -201,6 +202,26 @@ void tst_qdeclarativesmoothedanimation::behavior()
QTRY_COMPARE(theRect->y(), qreal(200));
}
+void tst_qdeclarativesmoothedanimation::zeroDuration()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/smoothedanimationZeroDuration.qml"));
+
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarativeRectangle *theRect = rect->findChild<QDeclarativeRectangle*>("theRect");
+ QVERIFY(theRect);
+
+ QDeclarativeSmoothedAnimation *easeX = rect->findChild<QDeclarativeSmoothedAnimation*>("easeX");
+ QVERIFY(easeX);
+ QVERIFY(easeX->isRunning());
+
+ QTRY_VERIFY(!easeX->isRunning());
+ QTRY_COMPARE(theRect->x(), qreal(200));
+}
+
QTEST_MAIN(tst_qdeclarativesmoothedanimation)
#include "tst_qdeclarativesmoothedanimation.moc"