diff options
Diffstat (limited to 'tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp')
-rw-r--r-- | tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp b/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp index 00869268..6352d02b 100644 --- a/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp +++ b/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp @@ -47,6 +47,7 @@ #include <private/qdeclarativeitem_p.h> #include <QVariantAnimation> #include <QEasingCurve> +#include <QSignalSpy> class tst_qdeclarativeanimations : public QObject { @@ -82,6 +83,7 @@ private slots: void doubleRegistrationBug(); void alwaysRunToEndRestartBug(); void transitionAssignmentBug(); + void zeroDurationTwoCompletedEmittedBug(); }; #define QTIMED_COMPARE(lhs, rhs) do { \ @@ -850,6 +852,24 @@ void tst_qdeclarativeanimations::transitionAssignmentBug() QCOMPARE(rect->property("nullObject").toBool(), false); } +void tst_qdeclarativeanimations::zeroDurationTwoCompletedEmittedBug() +{ + QDeclarativeRectangle rect; + QDeclarativePropertyAnimation animation; + animation.setTarget(&rect); + animation.setProperty("x"); + animation.setFrom(1); + animation.setTo(200); + animation.setDuration(0); + QVERIFY(animation.from() == 1); + QSignalSpy spy(&animation, SIGNAL(completed(void))); + animation.start(); + QVERIFY(!animation.isRunning()); + QCOMPARE(rect.x(), qreal(200)); + QCOMPARE(spy.size(), 1); +} + + QTEST_MAIN(tst_qdeclarativeanimations) #include "tst_qdeclarativeanimations.moc" |