summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2016-02-26 01:25:29 +0100
committerMarc Mutz <marc.mutz@kdab.com>2016-02-26 09:12:23 +0000
commit0a8fd9c620adfc5dd38f41fcd14537296fde13b6 (patch)
tree5c4d5bee89f1c7cfb728f1779af250805bb1fb0a
parentc320d5221f166d3657771ae55585cba051f8caef (diff)
tst_qguimetatype::flags(): port to QTypeInfoQuery
QTypeInfoQuery was introduced for 5.6 to decouple isStatic and isRelocatable so old code continues to work. But since this test still uses !isStatic to mean trivially-relocatable, it will fail as soon as one of the checked types is marked as Q_RELOCATABLE_TYPE instead of Q_MOVABLE_TYPE. Incidentally, such a change is in the pipeline for Qt 5.7/5.8, so fix the test by porting to QTypeInfoQuery. Do this in 5.6, because that's when QTypeInfoQuery was introduced. Change-Id: I06f815f26ca9b430e124c4a2f8de2a729999762b Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
-rw-r--r--tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp b/tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp
index d8709baa18..73a2f83bac 100644
--- a/tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp
+++ b/tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp
@@ -346,11 +346,11 @@ struct TypeAlignment
void tst_QGuiMetaType::flags_data()
{
QTest::addColumn<int>("type");
- QTest::addColumn<bool>("isMovable");
+ QTest::addColumn<bool>("isRelocatable");
QTest::addColumn<bool>("isComplex");
#define ADD_METATYPE_TEST_ROW(MetaTypeName, MetaTypeId, RealType) \
- QTest::newRow(#RealType) << MetaTypeId << bool(!QTypeInfo<RealType>::isStatic) << bool(QTypeInfo<RealType>::isComplex);
+ QTest::newRow(#RealType) << MetaTypeId << bool(QTypeInfoQuery<RealType>::isRelocatable) << bool(QTypeInfoQuery<RealType>::isComplex);
QT_FOR_EACH_STATIC_GUI_CLASS(ADD_METATYPE_TEST_ROW)
#undef ADD_METATYPE_TEST_ROW
}
@@ -358,12 +358,12 @@ QT_FOR_EACH_STATIC_GUI_CLASS(ADD_METATYPE_TEST_ROW)
void tst_QGuiMetaType::flags()
{
QFETCH(int, type);
- QFETCH(bool, isMovable);
+ QFETCH(bool, isRelocatable);
QFETCH(bool, isComplex);
QCOMPARE(bool(QMetaType::typeFlags(type) & QMetaType::NeedsConstruction), isComplex);
QCOMPARE(bool(QMetaType::typeFlags(type) & QMetaType::NeedsDestruction), isComplex);
- QCOMPARE(bool(QMetaType::typeFlags(type) & QMetaType::MovableType), isMovable);
+ QCOMPARE(bool(QMetaType::typeFlags(type) & QMetaType::MovableType), isRelocatable);
}