aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2023-12-21 11:07:10 +0100
committerUlf Hermann <ulf.hermann@qt.io>2023-12-22 09:50:35 +0100
commit49ea766c8f63ac36d002350d6255ea3cab52ddb6 (patch)
tree19e36c21f432e757070199bf96e038d9347e84b2 /tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
parent107c5da80c56cf2540c415810fc7b2b9a2540cd2 (diff)
QmlCompiler: Return early after reject()
Otherwise we can run into an infinite loop. Pick-to: 6.7 Fixes: QTBUG-120322 Change-Id: I81f9402beb48faf09b4fe148271d4347b84ddc5e Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io> Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp')
-rw-r--r--tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
index 30a3eca882..a0416ac159 100644
--- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
+++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
@@ -183,6 +183,7 @@ private slots:
void registerElimination();
void registerPropagation();
void renameAdjust();
+ void returnAfterReject();
void revisions();
void scopeIdLookup();
void scopeObjectDestruction();
@@ -3802,6 +3803,16 @@ void tst_QmlCppCodegen::renameAdjust()
QVERIFY(o);
}
+void tst_QmlCppCodegen::returnAfterReject()
+{
+ QQmlEngine engine;
+ QQmlComponent c(&engine, QUrl(u"qrc:/qt/qml/TestTypes/returnAfterReject.qml"_s));
+ QVERIFY2(c.isReady(), qPrintable(c.errorString()));
+ QScopedPointer<QObject> o(c.create());
+ QVERIFY(o);
+ QCOMPARE(o->property("bar").toInt(), 123);
+}
+
void tst_QmlCppCodegen::revisions()
{
QQmlEngine engine;