diff --git a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp index 9cdb1f47f8..a4bfc8ac9b 100644 --- a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp +++ b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp @@ -369,40 +369,40 @@ void tst_QMetaType::normalizedTypes() } #define TYPENAME_DATA(MetaTypeName, MetaTypeId, RealType)\ - QTest::newRow(#RealType) << QMetaType::MetaTypeName << #RealType; + QTest::newRow(#RealType) << int(QMetaType::MetaTypeName) << #RealType; void tst_QMetaType::typeName_data() { - QTest::addColumn("aType"); + QTest::addColumn("aType"); QTest::addColumn("aTypeName"); QT_FOR_EACH_STATIC_TYPE(TYPENAME_DATA) - QTest::newRow("QMetaType::UnknownType") << QMetaType::UnknownType << static_cast(0); + QTest::newRow("QMetaType::UnknownType") << int(QMetaType::UnknownType) << static_cast(0); - QTest::newRow("Whity") << static_cast(::qMetaTypeId >()) << QString::fromLatin1("Whity"); - QTest::newRow("Whity") << static_cast(::qMetaTypeId >()) << QString::fromLatin1("Whity"); - QTest::newRow("Testspace::Foo") << static_cast(::qMetaTypeId()) << QString::fromLatin1("TestSpace::Foo"); + QTest::newRow("Whity") << ::qMetaTypeId >() << QString::fromLatin1("Whity"); + QTest::newRow("Whity") << ::qMetaTypeId >() << QString::fromLatin1("Whity"); + QTest::newRow("Testspace::Foo") << ::qMetaTypeId() << QString::fromLatin1("TestSpace::Foo"); - QTest::newRow("-1") << QMetaType::Type(-1) << QString(); - QTest::newRow("-124125534") << QMetaType::Type(-124125534) << QString(); - QTest::newRow("124125534") << QMetaType::Type(124125534) << QString(); + QTest::newRow("-1") << -1 << QString(); + QTest::newRow("-124125534") << -124125534 << QString(); + QTest::newRow("124125534") << 124125534 << QString(); // automatic registration - QTest::newRow("QList") << static_cast(::qMetaTypeId >()) << QString::fromLatin1("QList"); - QTest::newRow("QHash") << static_cast(::qMetaTypeId >()) << QString::fromLatin1("QHash"); - QTest::newRow("QMap") << static_cast(::qMetaTypeId >()) << QString::fromLatin1("QMap"); - QTest::newRow("QVector>") << static_cast(::qMetaTypeId > >()) << QString::fromLatin1("QVector >"); - QTest::newRow("QVector>") << static_cast(::qMetaTypeId > >()) << QString::fromLatin1("QVector >"); + QTest::newRow("QList") << ::qMetaTypeId >() << QString::fromLatin1("QList"); + QTest::newRow("QHash") << ::qMetaTypeId >() << QString::fromLatin1("QHash"); + QTest::newRow("QMap") << ::qMetaTypeId >() << QString::fromLatin1("QMap"); + QTest::newRow("QVector>") << ::qMetaTypeId > >() << QString::fromLatin1("QVector >"); + QTest::newRow("QVector>") << ::qMetaTypeId > >() << QString::fromLatin1("QVector >"); - QTest::newRow("CustomQObject*") << static_cast(::qMetaTypeId()) << QString::fromLatin1("CustomQObject*"); - QTest::newRow("CustomGadget") << static_cast(::qMetaTypeId()) << QString::fromLatin1("CustomGadget"); - QTest::newRow("CustomQObject::CustomQEnum") << static_cast(::qMetaTypeId()) << QString::fromLatin1("CustomQObject::CustomQEnum"); - QTest::newRow("Qt::ArrowType") << static_cast(::qMetaTypeId()) << QString::fromLatin1("Qt::ArrowType"); + QTest::newRow("CustomQObject*") << ::qMetaTypeId() << QString::fromLatin1("CustomQObject*"); + QTest::newRow("CustomGadget") << ::qMetaTypeId() << QString::fromLatin1("CustomGadget"); + QTest::newRow("CustomQObject::CustomQEnum") << ::qMetaTypeId() << QString::fromLatin1("CustomQObject::CustomQEnum"); + QTest::newRow("Qt::ArrowType") << ::qMetaTypeId() << QString::fromLatin1("Qt::ArrowType"); } void tst_QMetaType::typeName() { - QFETCH(QMetaType::Type, aType); + QFETCH(int, aType); QFETCH(QString, aTypeName); QString name = QString::fromLatin1(QMetaType::typeName(aType)); @@ -413,15 +413,15 @@ void tst_QMetaType::typeName() void tst_QMetaType::type_data() { - QTest::addColumn("aType"); + QTest::addColumn("aType"); QTest::addColumn("aTypeName"); #define TST_QMETATYPE_TYPE_DATA(MetaTypeName, MetaTypeId, RealType)\ - QTest::newRow(#RealType) << QMetaType::MetaTypeName << QByteArray( #RealType ); + QTest::newRow(#RealType) << int(QMetaType::MetaTypeName) << QByteArray( #RealType ); #define TST_QMETATYPE_TYPE_DATA_ALIAS(MetaTypeName, MetaTypeId, AliasType, RealTypeString)\ - QTest::newRow(RealTypeString) << QMetaType::MetaTypeName << QByteArray( #AliasType ); + QTest::newRow(RealTypeString) << int(QMetaType::MetaTypeName) << QByteArray( #AliasType ); - QTest::newRow("empty") << QMetaType::UnknownType << QByteArray(); + QTest::newRow("empty") << int(QMetaType::UnknownType) << QByteArray(); QT_FOR_EACH_STATIC_TYPE(TST_QMETATYPE_TYPE_DATA) QT_FOR_EACH_STATIC_ALIAS_TYPE(TST_QMETATYPE_TYPE_DATA_ALIAS) @@ -432,13 +432,13 @@ void tst_QMetaType::type_data() void tst_QMetaType::type() { - QFETCH(QMetaType::Type, aType); + QFETCH(int, aType); QFETCH(QByteArray, aTypeName); // QMetaType::type(QByteArray) - QCOMPARE(QMetaType::type(aTypeName), int(aType)); + QCOMPARE(QMetaType::type(aTypeName), aType); // QMetaType::type(const char *) - QCOMPARE(QMetaType::type(aTypeName.constData()), int(aType)); + QCOMPARE(QMetaType::type(aTypeName.constData()), aType); } void tst_QMetaType::type_fromSubString_data() @@ -727,9 +727,9 @@ template<> struct TestValueFactory { void tst_QMetaType::create_data() { - QTest::addColumn("type"); + QTest::addColumn("type"); #define ADD_METATYPE_TEST_ROW(MetaTypeName, MetaTypeId, RealType) \ - QTest::newRow(QMetaType::typeName(QMetaType::MetaTypeName)) << QMetaType::MetaTypeName; + QTest::newRow(QMetaType::typeName(QMetaType::MetaTypeName)) << int(QMetaType::MetaTypeName); FOR_EACH_CORE_METATYPE(ADD_METATYPE_TEST_ROW) #undef ADD_METATYPE_TEST_ROW } @@ -781,7 +781,7 @@ FOR_EACH_CORE_METATYPE(RETURN_CREATE_FUNCTION) } }; - QFETCH(QMetaType::Type, type); + QFETCH(int, type); TypeTestFunctionGetter::get(type)(); } @@ -832,33 +832,33 @@ FOR_EACH_CORE_METATYPE(RETURN_CREATE_COPY_FUNCTION) } }; - QFETCH(QMetaType::Type, type); + QFETCH(int, type); TypeTestFunctionGetter::get(type)(); } void tst_QMetaType::sizeOf_data() { - QTest::addColumn("type"); + QTest::addColumn("type"); QTest::addColumn("size"); - QTest::newRow("QMetaType::UnknownType") << QMetaType::UnknownType << size_t(0); + QTest::newRow("QMetaType::UnknownType") << int(QMetaType::UnknownType) << size_t(0); #define ADD_METATYPE_TEST_ROW(MetaTypeName, MetaTypeId, RealType) \ - QTest::newRow(#RealType) << QMetaType::MetaTypeName << size_t(QTypeInfo::sizeOf); + QTest::newRow(#RealType) << int(QMetaType::MetaTypeName) << size_t(QTypeInfo::sizeOf); FOR_EACH_CORE_METATYPE(ADD_METATYPE_TEST_ROW) #undef ADD_METATYPE_TEST_ROW - QTest::newRow("Whity") << static_cast(::qMetaTypeId >()) << sizeof(Whity); -QTest::newRow("Whity") << static_cast(::qMetaTypeId >()) << sizeof(Whity); - QTest::newRow("Testspace::Foo") << static_cast(::qMetaTypeId()) << sizeof(TestSpace::Foo); + QTest::newRow("Whity") << ::qMetaTypeId >() << sizeof(Whity); + QTest::newRow("Whity") << ::qMetaTypeId >() << sizeof(Whity); + QTest::newRow("Testspace::Foo") << ::qMetaTypeId() << sizeof(TestSpace::Foo); - QTest::newRow("-1") << QMetaType::Type(-1) << size_t(0); - QTest::newRow("-124125534") << QMetaType::Type(-124125534) << size_t(0); - QTest::newRow("124125534") << QMetaType::Type(124125534) << size_t(0); + QTest::newRow("-1") << -1 << size_t(0); + QTest::newRow("-124125534") << -124125534 << size_t(0); + QTest::newRow("124125534") << 124125534 << size_t(0); } void tst_QMetaType::sizeOf() { - QFETCH(QMetaType::Type, type); + QFETCH(int, type); QFETCH(size_t, size); QCOMPARE(size_t(QMetaType::sizeOf(type)), size); } @@ -870,7 +870,7 @@ void tst_QMetaType::sizeOfStaticLess_data() void tst_QMetaType::sizeOfStaticLess() { - QFETCH(QMetaType::Type, type); + QFETCH(int, type); QFETCH(size_t, size); QCOMPARE(size_t(QMetaType(type).sizeOf()), size); } @@ -1126,7 +1126,7 @@ FOR_EACH_CORE_METATYPE(RETURN_CONSTRUCT_FUNCTION) } }; - QFETCH(QMetaType::Type, type); + QFETCH(int, type); TypeTestFunctionGetter::get(type)(); } @@ -1194,7 +1194,7 @@ FOR_EACH_CORE_METATYPE(RETURN_CONSTRUCT_COPY_FUNCTION) } }; - QFETCH(QMetaType::Type, type); + QFETCH(int, type); TypeTestFunctionGetter::get(type)(); }