aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp')
-rw-r--r--tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
index e5e7597cb6..bb9789d63d 100644
--- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
+++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
@@ -177,6 +177,7 @@ private slots:
void boolCoercions();
void ambiguousAs();
void boolPointerMerge();
+ void mergedObjectReadWrite();
};
void tst_QmlCppCodegen::initTestCase()
@@ -3558,6 +3559,31 @@ void tst_QmlCppCodegen::boolPointerMerge()
QCOMPARE(item->property("ppp").toInt(), -99);
}
+void tst_QmlCppCodegen::mergedObjectReadWrite()
+{
+ QQmlEngine e;
+ {
+ QQmlComponent c(&e, QUrl(u"qrc:/qt/qml/TestTypes/mergedObjectRead.qml"_s));
+ QVERIFY2(c.isReady(), qPrintable(c.errorString()));
+ QTest::ignoreMessage(QtDebugMsg, "null");
+ QTest::ignoreMessage(
+ QtWarningMsg, QRegularExpression("TypeError: Cannot read property 'x' of null"));
+ QScopedPointer<QObject> o(c.create());
+ QVERIFY(!o.isNull());
+ }
+
+ {
+ QQmlComponent c(&e, QUrl(u"qrc:/qt/qml/TestTypes/mergedObjectWrite.qml"_s));
+ QVERIFY2(c.isReady(), qPrintable(c.errorString()));
+ QTest::ignoreMessage(
+ QtWarningMsg,
+ QRegularExpression(
+ "TypeError: Value is null and could not be converted to an object"));
+ QScopedPointer<QObject> o(c.create());
+ QVERIFY(!o.isNull());
+ }
+}
+
QTEST_MAIN(tst_QmlCppCodegen)
#include "tst_qmlcppcodegen.moc"