diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2011-02-21 16:11:50 +1000 |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2011-02-22 11:12:22 +1000 |
commit | 5fa90e4bc83541dc23db150166157e2a3f04a668 (patch) | |
tree | 3a82d613dbd1a7c80e5fa1c30c488022c49ee31a /tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp | |
parent | 0c24787a2f35a7b0585c9dfb3bf0a8cb34ce867f (diff) | |
download | qt4-tools-5fa90e4bc83541dc23db150166157e2a3f04a668.tar.gz |
Prevent an animation from being registered to run twice.
This could cause animations to start running that could not later be
stopped.
Change-Id: I320f50121f3566619f08181664d049b02e2848e5
Reviewed-by: Martin Jones
Diffstat (limited to 'tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp')
-rw-r--r-- | tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp b/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp index d1b7c1b0f9..f7fee3b679 100644 --- a/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp +++ b/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp @@ -86,6 +86,7 @@ private slots: void runningTrueBug(); void nonTransitionBug(); void registrationBug(); + void doubleRegistrationBug(); }; #define QTIMED_COMPARE(lhs, rhs) do { \ @@ -805,6 +806,19 @@ void tst_qdeclarativeanimations::registrationBug() QTRY_COMPARE(rect->property("value"), QVariant(int(100))); } +void tst_qdeclarativeanimations::doubleRegistrationBug() +{ + QDeclarativeEngine engine; + + QDeclarativeComponent c(&engine, SRCDIR "/data/doubleRegistrationBug.qml"); + QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create()); + QVERIFY(rect != 0); + + QDeclarativeAbstractAnimation *anim = rect->findChild<QDeclarativeAbstractAnimation*>("animation"); + QVERIFY(anim != 0); + QTRY_COMPARE(anim->qtAnimation()->state(), QAbstractAnimation::Stopped); +} + QTEST_MAIN(tst_qdeclarativeanimations) #include "tst_qdeclarativeanimations.moc" |