aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qtquick2/qdeclarativesmoothedanimation/tst_qdeclarativesmoothedanimation.cpp
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2012-02-13 10:11:26 +1000
committerQt by Nokia <qt-info@nokia.com>2012-02-13 10:27:31 +0100
commit815b4b463da83802f535b328d7ef699aea529a6b (patch)
tree27a6dfcb21dd353bc81231cf2b60369107ef9078 /tests/auto/qtquick2/qdeclarativesmoothedanimation/tst_qdeclarativesmoothedanimation.cpp
parentab84713eb211fdcc2fc63be6860498d4b4186d11 (diff)
Don't crash when an animation update causes it to delete itself.
Change-Id: Ic108adfb99a09e6ede71d474240fb0917cee6961 Reviewed-by: Bea Lam <bea.lam@nokia.com>
Diffstat (limited to 'tests/auto/qtquick2/qdeclarativesmoothedanimation/tst_qdeclarativesmoothedanimation.cpp')
-rw-r--r--tests/auto/qtquick2/qdeclarativesmoothedanimation/tst_qdeclarativesmoothedanimation.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/qtquick2/qdeclarativesmoothedanimation/tst_qdeclarativesmoothedanimation.cpp b/tests/auto/qtquick2/qdeclarativesmoothedanimation/tst_qdeclarativesmoothedanimation.cpp
index 3d37517d10..09bde4ad76 100644
--- a/tests/auto/qtquick2/qdeclarativesmoothedanimation/tst_qdeclarativesmoothedanimation.cpp
+++ b/tests/auto/qtquick2/qdeclarativesmoothedanimation/tst_qdeclarativesmoothedanimation.cpp
@@ -59,6 +59,7 @@ private slots:
void simpleAnimation();
void valueSource();
void behavior();
+ void deleteOnUpdate();
private:
QDeclarativeEngine engine;
@@ -218,6 +219,24 @@ void tst_qdeclarativesmoothedanimation::behavior()
delete rect;
}
+void tst_qdeclarativesmoothedanimation::deleteOnUpdate()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, testFileUrl("deleteOnUpdate.qml"));
+
+ QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarativeSmoothedAnimation *anim = rect->findChild<QDeclarativeSmoothedAnimation*>("anim");
+ QVERIFY(anim);
+
+ //don't crash
+ QTest::qWait(500);
+
+ delete rect;
+}
+
QTEST_MAIN(tst_qdeclarativesmoothedanimation)
#include "tst_qdeclarativesmoothedanimation.moc"