From 779f6cf08c1bcb9d54a4e75c81a63689edab2df4 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Fri, 23 Jun 2023 11:02:18 +0200 Subject: QmlCompiler: Add further tests for DTZ Apparently we had some intermediate state where these ones were broken. Let's make sure this doesn't happen again. Pick-to: 6.6 Fixes: QTBUG-113403 Change-Id: If1da8200afe5c7cee417cd755a15251979fb18c5 Reviewed-by: Fabian Kosmale --- tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp') diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp index db9701d033..2ccd104ed9 100644 --- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp +++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp @@ -42,6 +42,7 @@ private slots: void attachedType(); void badSequence(); void basicBlocksWithBackJump(); + void basicDTZ(); void bindToValueType(); void bindingExpression(); void blockComments(); @@ -735,6 +736,23 @@ void tst_QmlCppCodegen::basicBlocksWithBackJump() QVERIFY(!expectingMessage); } +void tst_QmlCppCodegen::basicDTZ() +{ + QQmlEngine engine; + QQmlComponent component(&engine, QUrl(u"qrc:/qt/qml/TestTypes/basicDTZ.qml"_s)); + QVERIFY2(component.isReady(), qPrintable(component.errorString())); + QScopedPointer o(component.create()); + QVERIFY(!o.isNull()); + + QCOMPARE(o->property("title").toString(), u"none"); + + QMetaObject::invokeMethod(o.data(), "t1"); + QMetaObject::invokeMethod(o.data(), "t2"); + QMetaObject::invokeMethod(o.data(), "t3"); + + QCOMPARE(o->property("title").toString(), u"Baz 41"); +} + void tst_QmlCppCodegen::bindToValueType() { QQmlEngine engine; -- cgit v1.2.3