diff options
Diffstat (limited to 'tests/auto/qml/qqmlengine/tst_qqmlengine.cpp')
-rw-r--r-- | tests/auto/qml/qqmlengine/tst_qqmlengine.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp b/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp index 52e18011cb..6ae786469d 100644 --- a/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp +++ b/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp @@ -77,6 +77,7 @@ private slots: void testGCCorruption(); void testGroupedPropertyRevisions(); void componentFromEval(); + void qrcUrls(); public slots: QObject *createAQObjectForOwnershipTest () @@ -897,6 +898,32 @@ void tst_qqmlengine::componentFromEval() QVERIFY(!item.isNull()); } +void tst_qqmlengine::qrcUrls() +{ + QQmlEngine engine; + QQmlEnginePrivate *pEngine = QQmlEnginePrivate::get(&engine); + + { + QQmlRefPointer<QQmlTypeData> oneQml(pEngine->typeLoader.getType(QUrl("qrc:/qrcurls.qml")), + QQmlRefPointer<QQmlTypeData>::Adopt); + QVERIFY(oneQml != nullptr); + QQmlRefPointer<QQmlTypeData> twoQml(pEngine->typeLoader.getType(QUrl("qrc:///qrcurls.qml")), + QQmlRefPointer<QQmlTypeData>::Adopt); + QVERIFY(twoQml != nullptr); + QCOMPARE(oneQml, twoQml); + } + + { + QQmlRefPointer<QQmlTypeData> oneJS(pEngine->typeLoader.getType(QUrl("qrc:/qrcurls.js")), + QQmlRefPointer<QQmlTypeData>::Adopt); + QVERIFY(oneJS != nullptr); + QQmlRefPointer<QQmlTypeData> twoJS(pEngine->typeLoader.getType(QUrl("qrc:///qrcurls.js")), + QQmlRefPointer<QQmlTypeData>::Adopt); + QVERIFY(twoJS != nullptr); + QCOMPARE(oneJS, twoJS); + } +} + QTEST_MAIN(tst_qqmlengine) #include "tst_qqmlengine.moc" |