aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2025-09-11 12:18:14 +0200
committerUlf Hermann <ulf.hermann@qt.io>2025-09-18 06:59:40 +0000
commit230b09360e3789cd533dca8ab526734af6081366 (patch)
tree500b5f5c4bf4951bc3b8121ec30543edd2ceb675 /tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
parente21e6551bf812cb7c9814a24b7dc90ab3d92d029 (diff)
tst_qmlcppcodegen: Adjust to fixed binding behavior in qtbase
If the binding throws an exception, the binding wrapper internally returns false. This should result in the value being discarded. We had a long standing bug in qtbase that caused the value to still be accepted in certain cases. Commit 440a63a33e7176167d91244467fa380bae684173 fixed that. Fixes: QTBUG-140161 Change-Id: Ib36a32909dc3d487bea887cb7f89d7fcfeca2031 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp')
-rw-r--r--tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
index 5780862b47..90fd5f391c 100644
--- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
+++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
@@ -1104,7 +1104,8 @@ void tst_QmlCppCodegen::callObjectLookupOnNull()
qPrintable(urlString + u":5:5: TypeError: Cannot call method 'getName' of null"));
o->setProperty("person", QVariant::fromValue<Person *>(nullptr));
- QCOMPARE(o->objectName(), QString());
+ // Since the binding threw an exception, we expect the value _not_ to get updated.
+ QCOMPARE(o->objectName(), u"horst"_s);
}
void tst_QmlCppCodegen::callWithSpread()