aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickloader/tst_qquickloader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/quick/qquickloader/tst_qquickloader.cpp')
-rw-r--r--tests/auto/quick/qquickloader/tst_qquickloader.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickloader/tst_qquickloader.cpp b/tests/auto/quick/qquickloader/tst_qquickloader.cpp
index dddacbaa0b..db678ae5a1 100644
--- a/tests/auto/quick/qquickloader/tst_qquickloader.cpp
+++ b/tests/auto/quick/qquickloader/tst_qquickloader.cpp
@@ -133,6 +133,7 @@ private slots:
void setSourceAndCheckStatus();
void asyncLoaderRace();
+ void noEngine();
};
Q_DECLARE_METATYPE(QList<QQmlError>)
@@ -1515,6 +1516,20 @@ void tst_QQuickLoader::asyncLoaderRace()
QCOMPARE(loader->item(), nullptr);
}
+void tst_QQuickLoader::noEngine()
+{
+ QQmlEngine engine;
+ const QUrl url = testFileUrl("noEngine.qml");
+ QQmlComponent component(&engine, url);
+ QVERIFY2(component.isReady(), qPrintable(component.errorString()));
+ QScopedPointer<QObject> o(component.create());
+
+ const QString message = url.toString()
+ + QStringLiteral(":27:13: QML Loader: createComponent: Cannot find a QML engine.");
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(message));
+ QTRY_COMPARE(o->property("changes").toInt(), 1);
+}
+
QTEST_MAIN(tst_QQuickLoader)
#include "tst_qquickloader.moc"