summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2011-01-27 08:43:01 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2011-01-27 08:46:20 (GMT)
commiteb55d07febf858474d8755e31cb554a4b8fabcdc (patch)
treea1b5bf4f51ed31fc92373698c7f1924b6d0ca4cc /tests
parent4f124cd0177aa79d17361c3d79669730b6d97adc (diff)
downloadQt-eb55d07febf858474d8755e31cb554a4b8fabcdc.zip
Qt-eb55d07febf858474d8755e31cb554a4b8fabcdc.tar.gz
Qt-eb55d07febf858474d8755e31cb554a4b8fabcdc.tar.bz2
Don't crash when appending a null item
Task-number: QTBUG-16871
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/qdeclarativeitem/data/qtbug_16871.qml5
-rw-r--r--tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp9
2 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeitem/data/qtbug_16871.qml b/tests/auto/declarative/qdeclarativeitem/data/qtbug_16871.qml
new file mode 100644
index 0000000..8102df1
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeitem/data/qtbug_16871.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+Item {
+ children: [ 10 ]
+}
diff --git a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
index 447b57b..137522d 100644
--- a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
+++ b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
@@ -86,6 +86,7 @@ private slots:
void implicitSize();
void testQtQuick11Attributes();
void testQtQuick11Attributes_data();
+ void qtbug_16871();
private:
template<typename T>
@@ -994,6 +995,14 @@ void tst_QDeclarativeItem::testQtQuick11Attributes_data()
<< ":1 \"Item.onImplicitHeightChanged\" is not available in QtQuick 1.0.\n";
}
+void tst_QDeclarativeItem::qtbug_16871()
+{
+ QDeclarativeComponent component(&engine, SRCDIR "/data/qtbug_16871.qml");
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+ delete o;
+}
+
template<typename T>
T *tst_QDeclarativeItem::findItem(QGraphicsObject *parent, const QString &objectName)