aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcppcodegen/data
diff options
context:
space:
mode:
authorSemih Yavuz <semih.yavuz@qt.io>2023-01-31 14:00:04 +0100
committerSemih Yavuz <semih.yavuz@qt.io>2023-01-31 19:12:21 +0100
commitdb71a35b1e20b028e4e07c8229551fea8ac0eafb (patch)
treef2e57af0d9de0dba006c4a71a229e1d67f4d2724 /tests/auto/qml/qmlcppcodegen/data
parente23ea6cf3ce1565fa2265e7985257a4d69526f59 (diff)
qmlcachegen: Improve QObject comparison code generation test
The code generated for QObject comparisons holds for both weak and strong comparisons. Improve tst_qmlcppcodegen by adding missing weak comparison tests. Amends afc7928d1a1e47ecbc9d101c4e5d5fb1c5b78326. Pick-to: 6.5 Change-Id: Ib6176a39b329e792b81b3d8e8a288dcea074320b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/data')
-rw-r--r--tests/auto/qml/qmlcppcodegen/data/equalityQObjects.qml8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/data/equalityQObjects.qml b/tests/auto/qml/qmlcppcodegen/data/equalityQObjects.qml
index ce2da605d7..199f80884f 100644
--- a/tests/auto/qml/qmlcppcodegen/data/equalityQObjects.qml
+++ b/tests/auto/qml/qmlcppcodegen/data/equalityQObjects.qml
@@ -16,4 +16,12 @@ QtObject {
property bool compareSameObjects: sameNonNullObject === nonNullObject
property bool compareDifferentObjects: derivedObject !== nonNullObject
property bool compareObjectWithNullObject: nullObject !== nonNullObject
+
+ // Above tests should hold true for the weak comparisons
+ property bool nonStrict_derivedIsNotNull: derivedObject != null
+ property bool nonStrict_nullObjectIsNull: nullObject == null
+ property bool nonStrict_nonNullObjectIsNotNull: null != nonNullObject
+ property bool nonStrict_compareSameObjects: sameNonNullObject == nonNullObject
+ property bool nonStrict_compareDifferentObjects: derivedObject != nonNullObject
+ property bool nonStrict_compareObjectWithNullObject: nullObject != nonNullObject
}