aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJacek Całusiński <forger@forger.pl>2013-11-14 17:53:58 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-15 16:33:46 +0100
commite2ca539562fd7fd2eb33c56c5d5d9c0e5196b7af (patch)
tree402559966d1884b5737df2cf728ead1bab0d9c61 /tests
parent965607836664741db4e33e05792ec4f59c88dc55 (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')
-rw-r--r--tests/auto/quick/qquickanimations/data/parallelAnimationNullChildBug.qml6
-rw-r--r--tests/auto/quick/qquickanimations/data/sequentialAnimationNullChildBug.qml6
-rw-r--r--tests/auto/quick/qquickanimations/tst_qquickanimations.cpp26
3 files changed, 38 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickanimations/data/parallelAnimationNullChildBug.qml b/tests/auto/quick/qquickanimations/data/parallelAnimationNullChildBug.qml
new file mode 100644
index 0000000000..8da3e8e1af
--- /dev/null
+++ b/tests/auto/quick/qquickanimations/data/parallelAnimationNullChildBug.qml
@@ -0,0 +1,6 @@
+import QtQuick 2.2
+
+Item {
+ id: root
+ Component.onCompleted: Qt.createQmlObject("import QtQuick 2.2; ParallelAnimation{animations: [null]}", root)
+}
diff --git a/tests/auto/quick/qquickanimations/data/sequentialAnimationNullChildBug.qml b/tests/auto/quick/qquickanimations/data/sequentialAnimationNullChildBug.qml
new file mode 100644
index 0000000000..7a5c6063c4
--- /dev/null
+++ b/tests/auto/quick/qquickanimations/data/sequentialAnimationNullChildBug.qml
@@ -0,0 +1,6 @@
+import QtQuick 2.2
+
+Item {
+ id: root
+ Component.onCompleted: Qt.createQmlObject("import QtQuick 2.2; SequentialAnimation{animations: [null]}", root)
+}
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"