diff options
author | Jacek Całusiński <forger@forger.pl> | 2013-11-14 17:53:58 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-11-15 16:33:46 +0100 |
commit | e2ca539562fd7fd2eb33c56c5d5d9c0e5196b7af (patch) | |
tree | 402559966d1884b5737df2cf728ead1bab0d9c61 /tests/auto/quick/qquickanimations/tst_qquickanimations.cpp | |
parent | 965607836664741db4e33e05792ec4f59c88dc55 (diff) |
Do not crash when one of group animation's children is null
Check if pointer to QQuickAbstractAnimation for which we are setting
group is valid.
Task-number: QTBUG-34851
Change-Id: Iecb549f080804fd9489f884911fa51892def05a5
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'tests/auto/quick/qquickanimations/tst_qquickanimations.cpp')
-rw-r--r-- | tests/auto/quick/qquickanimations/tst_qquickanimations.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickanimations/tst_qquickanimations.cpp b/tests/auto/quick/qquickanimations/tst_qquickanimations.cpp index 94726aa5fe..c6f4779819 100644 --- a/tests/auto/quick/qquickanimations/tst_qquickanimations.cpp +++ b/tests/auto/quick/qquickanimations/tst_qquickanimations.cpp @@ -110,6 +110,7 @@ private slots: void anchorBug(); void pathAnimationInOutBackBug(); void scriptActionBug(); + void groupAnimationNullChildBug(); }; #define QTIMED_COMPARE(lhs, rhs) do { \ @@ -1450,6 +1451,31 @@ void tst_qquickanimations::scriptActionBug() QCOMPARE(obj->property("actionTriggered").toBool(), true); } +//QTBUG-34851 +void tst_qquickanimations::groupAnimationNullChildBug() +{ + { + QQmlEngine engine; + + QQmlComponent c(&engine, testFileUrl("sequentialAnimationNullChildBug.qml")); + QQuickItem *root = qobject_cast<QQuickItem*>(c.create()); + QVERIFY(root); + + delete root; + } + + { + QQmlEngine engine; + + QQmlComponent c(&engine, testFileUrl("parallelAnimationNullChildBug.qml")); + QQuickItem *root = qobject_cast<QQuickItem*>(c.create()); + QVERIFY(root); + + delete root; + } +} + + QTEST_MAIN(tst_qquickanimations) #include "tst_qquickanimations.moc" |