summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp')
-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()