diff options
author | Fabian Kosmale <[email protected]> | 2025-09-17 09:11:22 +0200 |
---|---|---|
committer | Fabian Kosmale <[email protected]> | 2025-09-18 08:59:42 +0200 |
commit | f3b3395f10821965aaedb734645cf9c10f10e46c (patch) | |
tree | 1368e1f094fd3ef151b7befcee0b007aeea68681 | |
parent | 230b09360e3789cd533dca8ab526734af6081366 (diff) |
tst_qqmlconnections: Adjust test condition to qtbase change
If the binding throws an exception, the binding wrapper internally
returns false. This should result in the value being ignored, but wasn't
for QObjectCompatProperty targets. That was fixed with
440a63a33e7176167d91244467fa380bae684173. However the test assumed that
the binding would instead evaluate the error to an empty string. Adjust
the condition to properly handle that.
Change-Id: I6ff38c913866edbc9632bb854db00c29af036c82
Reviewed-by: Olivier De Cannière <[email protected]>
-rw-r--r-- | tests/auto/qml/qqmlconnections/data/invalidTarget.qml | 2 | ||||
-rw-r--r-- | tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp | 7 |
2 files changed, 2 insertions, 7 deletions
diff --git a/tests/auto/qml/qqmlconnections/data/invalidTarget.qml b/tests/auto/qml/qqmlconnections/data/invalidTarget.qml index 23599649ec..b63ca3cfcf 100644 --- a/tests/auto/qml/qqmlconnections/data/invalidTarget.qml +++ b/tests/auto/qml/qqmlconnections/data/invalidTarget.qml @@ -2,7 +2,7 @@ import QtQml QtObject { id: root - objectName: button.objectName + objectName: button?.objectName ?? "" property QtObject b: QtObject { objectName: "button" diff --git a/tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp b/tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp index 88441e9dac..6c32af02cf 100644 --- a/tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp +++ b/tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp @@ -454,12 +454,7 @@ void tst_qqmlconnections::invalidTarget() QVERIFY(root); QCOMPARE(root->objectName(), QStringLiteral("button")); - QTest::ignoreMessage( - QtWarningMsg, - qPrintable( - url.toString() - + QLatin1String(":5:5: TypeError: Cannot read property 'objectName' of null"))); - QTRY_VERIFY(root->objectName().isEmpty()); + QTRY_VERIFY2(root->objectName().isEmpty(), qPrintable(root->objectName())); } void tst_qqmlconnections::badSignalHandlerName() |