From 23636d42815461710167e26df4a937cd6d975b37 Mon Sep 17 00:00:00 2001 From: Fabian Kosmale Date: Mon, 1 Mar 2021 09:27:17 +0100 Subject: 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 --- tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'tests') 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() -- cgit v1.2.3