aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2019-07-03 09:25:53 +0200
committerUlf Hermann <ulf.hermann@qt.io>2019-07-03 14:55:47 +0200
commitb79b9e35334b3bdd41329f2ea74bc82f3f05ae52 (patch)
tree9cd483260c969e370c54306c1c4c5a088bc0df41 /tests
parent75ba1ce9114e320cccfbc0c14dd32675ce2e598e (diff)
Create a URL from the import string before adding the qmldir path
Otherwise the path might get interpreted as some other part of the URL, for example the host name. Fixes: QTBUG-76441 Change-Id: I3edde96153403962db4576e5af794419c21b49a8 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qml/qqmltypeloader/data/qrcRootPath.qml4
-rw-r--r--tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp8
2 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmltypeloader/data/qrcRootPath.qml b/tests/auto/qml/qqmltypeloader/data/qrcRootPath.qml
new file mode 100644
index 0000000000..bdbee4eb59
--- /dev/null
+++ b/tests/auto/qml/qqmltypeloader/data/qrcRootPath.qml
@@ -0,0 +1,4 @@
+import QtQml 2.12
+import "qrc:/"
+
+QtObject {}
diff --git a/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp b/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp
index 0c4abf19f4..52c722aac8 100644
--- a/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp
+++ b/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp
@@ -56,6 +56,7 @@ private slots:
void qmlSingletonWithinModule();
void multiSingletonModule();
void implicitComponentModule();
+ void qrcRootPathUrl();
};
void tst_QQMLTypeLoader::testLoadComplete()
@@ -503,6 +504,13 @@ void tst_QQMLTypeLoader::implicitComponentModule()
checkCleanCacheLoad(QLatin1String("implicitComponentModule"));
}
+void tst_QQMLTypeLoader::qrcRootPathUrl()
+{
+ QQmlEngine engine;
+ QQmlComponent component(&engine, testFileUrl("qrcRootPath.qml"));
+ QCOMPARE(component.status(), QQmlComponent::Ready);
+}
+
QTEST_MAIN(tst_QQMLTypeLoader)
#include "tst_qqmltypeloader.moc"