summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/kernel/qmetatype
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2021-03-01 09:27:17 +0100
committerFabian Kosmale <fabian.kosmale@qt.io>2021-03-05 10:19:45 +0000
commit23636d42815461710167e26df4a937cd6d975b37 (patch)
tree39efeeec606f1ed184c62066d931f1c0067cecad /tests/auto/corelib/kernel/qmetatype
parent5f501b0e975f8985c468218a103a497ca123cf7b (diff)
tst_qmetatype: RELOCATABLE -> PRIMITIVE is binary compatible
Based on the discussion in https://codereview.qt-project.org/c/qt/qtbase/+/336742 changing our types from RELOCATABLE to PRIMITVE is fine. Change-Id: Ica867203aa813d19fdfd3753fc4ff36ef4332fc3 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests/auto/corelib/kernel/qmetatype')
-rw-r--r--tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
index 81a67f1b78..df9beabe73 100644
--- a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
+++ b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
@@ -1092,9 +1092,18 @@ void tst_QMetaType::flagsBinaryCompatibility6_0()
QFETCH(quint32, id);
QFETCH(quint32, flags);
+ const auto currentFlags = QMetaType::typeFlags(id);
+ auto expectedFlags = QMetaType::TypeFlags(flags);
+ if (!(currentFlags.testFlag(QMetaType::NeedsConstruction) && currentFlags.testFlag(QMetaType::NeedsDestruction))) {
+ if (expectedFlags.testFlag(QMetaType::NeedsConstruction) && expectedFlags.testFlag(QMetaType::NeedsDestruction)) {
+ // If type changed from RELOCATABLE to trivial, that's fine
+ expectedFlags.setFlag(QMetaType::NeedsConstruction, false);
+ expectedFlags.setFlag(QMetaType::NeedsDestruction, false);
+ }
+ }
quint32 mask_5_0 = 0x1fb; // Only compare the values that were already defined in 5.0
- QCOMPARE(quint32(QMetaType::typeFlags(id)) & mask_5_0, flags & mask_5_0);
+ QCOMPARE(quint32(currentFlags) & mask_5_0, quint32(expectedFlags) & mask_5_0);
}
void tst_QMetaType::construct_data()