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>
bb10
Fabian Kosmale 2021-03-01 09:27:17 +01:00
parent 5f501b0e97
commit 23636d4281
1 changed files with 10 additions and 1 deletions

View File

@ -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()