aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickrepeater/tst_qquickrepeater.cpp
diff options
context:
space:
mode:
authorMatthew Vogt <matthew.vogt@nokia.com>2012-03-13 15:06:40 +1000
committerMatthew Vogt <matthew.vogt@nokia.com>2012-03-13 15:22:14 +1000
commit784555f3032194a8923d804a8ce84957f113caf6 (patch)
tree6b538cea5bf82bd5288ac180125abd1bb312ddad /tests/auto/quick/qquickrepeater/tst_qquickrepeater.cpp
parent1f52c5430144eb7ba6baa7e3954675ca0707b947 (diff)
parent648c80c4c0759efb6e35fac7acc8daad5aab13e2 (diff)
Merge branch 'master' of git://gitorious.org/qt/qtdeclarative into merge-master
Diffstat (limited to 'tests/auto/quick/qquickrepeater/tst_qquickrepeater.cpp')
-rw-r--r--tests/auto/quick/qquickrepeater/tst_qquickrepeater.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickrepeater/tst_qquickrepeater.cpp b/tests/auto/quick/qquickrepeater/tst_qquickrepeater.cpp
index 1b07a6e9f8..d9cbed093a 100644
--- a/tests/auto/quick/qquickrepeater/tst_qquickrepeater.cpp
+++ b/tests/auto/quick/qquickrepeater/tst_qquickrepeater.cpp
@@ -77,6 +77,7 @@ private slots:
void properties();
void asynchronous();
void initParent();
+ void dynamicModelCrash();
};
class TestObject : public QObject
@@ -639,6 +640,20 @@ void tst_QQuickRepeater::initParent()
QCOMPARE(qvariant_cast<QQuickItem*>(rootObject->property("parentItem")), rootObject);
}
+void tst_QQuickRepeater::dynamicModelCrash()
+{
+ QQmlEngine engine;
+ QQmlComponent component(&engine, testFileUrl("dynamicmodelcrash.qml"));
+
+ // Don't crash
+ QQuickItem *rootObject = qobject_cast<QQuickItem*>(component.create());
+ QVERIFY(rootObject);
+
+ QQuickRepeater *repeater = findItem<QQuickRepeater>(rootObject, "rep");
+ QVERIFY(repeater);
+ QVERIFY(qvariant_cast<QObject *>(repeater->model()) == 0);
+}
+
QTEST_MAIN(tst_QQuickRepeater)
#include "tst_qquickrepeater.moc"