summaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp')
-rw-r--r--tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp b/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp
index 7c7c7d3bd0..a872cece96 100644
--- a/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp
+++ b/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp
@@ -121,6 +121,7 @@ private slots:
void setNonExistentInitialProperty();
void relativeUrl_data();
void relativeUrl();
+ void setDataNoEngineNoSegfault();
private:
QQmlEngine engine;
@@ -654,6 +655,17 @@ void tst_qqmlcomponent::relativeUrl()
QVERIFY2(!component.isError(), qPrintable(component.errorString()));
}
+void tst_qqmlcomponent::setDataNoEngineNoSegfault()
+{
+ QQmlEngine eng;
+ QQmlComponent comp;
+ QTest::ignoreMessage(QtWarningMsg, "QQmlComponent: Must provide an engine before calling setData");
+ comp.setData("import QtQuick 1.0; QtObject { }", QUrl(""));
+ QTest::ignoreMessage(QtWarningMsg, "QQmlComponent: Must provide an engine before calling create");
+ auto c = comp.create();
+ QVERIFY(!c);
+}
+
QTEST_MAIN(tst_qqmlcomponent)
#include "tst_qqmlcomponent.moc"