aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qml/qqmllanguage/data/NullPointerPropertyCache.qml10
-rw-r--r--tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp10
2 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmllanguage/data/NullPointerPropertyCache.qml b/tests/auto/qml/qqmllanguage/data/NullPointerPropertyCache.qml
new file mode 100644
index 0000000000..052893936a
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/NullPointerPropertyCache.qml
@@ -0,0 +1,10 @@
+import QtQuick 2.0
+
+ListView {
+ property alias defaultHighlight: defaultHighlight
+
+ Component {
+ id: defaultHighlight
+ Item {}
+ }
+}
diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
index b67ee148f4..e5ac59f379 100644
--- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
+++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
@@ -333,6 +333,7 @@ private slots:
void arrayToContainer();
void qualifiedScopeInCustomParser();
+ void accessNullPointerPropertyCache();
void checkUncreatableNoReason();
@@ -5951,6 +5952,15 @@ void tst_qqmllanguage::checkURLtoURLObject()
QCOMPARE(c.errors().count(), 0);
}
+void tst_qqmllanguage::accessNullPointerPropertyCache()
+{
+ QQmlEngine engine;
+ QQmlComponent c(&engine, testFileUrl("NullPointerPropertyCache.qml"));
+ QVERIFY(c.isReady());
+ QScopedPointer<QObject> obj(c.create());
+ QVERIFY(!obj.isNull());
+}
+
QTEST_MAIN(tst_qqmllanguage)
#include "tst_qqmllanguage.moc"