aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp')
-rw-r--r--tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp b/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp
index bc6451dac0..b999b5b9d1 100644
--- a/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp
+++ b/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp
@@ -77,6 +77,7 @@ private slots:
void parameterAdjustment();
void inlineComponent();
+ void posthocRequired();
};
// A wrapper around QQmlComponent to ensure the temporary reference counts
@@ -704,6 +705,17 @@ void tst_qmlcachegen::inlineComponent()
QVERIFY(!obj.isNull());
}
+void tst_qmlcachegen::posthocRequired()
+{
+ bool ok = generateCache(testFile("posthocrequired.qml"));
+ QVERIFY(ok);
+ QQmlEngine engine;
+ CleanlyLoadingComponent component(&engine, testFileUrl("posthocrequired.qml"));
+ QScopedPointer<QObject> obj(component.create());
+ QVERIFY(obj.isNull() && component.isError());
+ QVERIFY(component.errorString().contains(QStringLiteral("Required property x was not initialized")));
+}
+
QTEST_GUILESS_MAIN(tst_qmlcachegen)
#include "tst_qmlcachegen.moc"