diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2016-01-19 10:00:53 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2016-01-19 10:03:01 +0100 |
commit | 8f569c740a91b98365dcdaee2444038ce4957a76 (patch) | |
tree | 749302d8bf9023ae51873a74dc641fd005744502 /tests/auto/corelib/kernel/qmetatype | |
parent | 465e93aa95d99f799300867b07f81bdd5162c9f1 (diff) | |
parent | e8ad49d6cba6521f20b1b08bf65d92fc81c158e4 (diff) |
Merge remote-tracking branch 'origin/5.5' into 5.6
Conflicts:
config.tests/common/atomic64/atomic64.cpp
configure
src/3rdparty/forkfd/forkfd.c
src/corelib/io/forkfd_qt.cpp
src/widgets/kernel/qwidgetwindow.cpp
tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp
tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp
tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
tools/configure/configureapp.cpp
Change-Id: Ic6168d82e51a0ef1862c3a63bee6722e8f138414
Diffstat (limited to 'tests/auto/corelib/kernel/qmetatype')
-rw-r--r-- | tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp | 86 |
1 files changed, 43 insertions, 43 deletions
diff --git a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp index 10ffa06245..c74a43b682 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<QMetaType::Type>("aType"); + QTest::addColumn<int>("aType"); QTest::addColumn<QString>("aTypeName"); QT_FOR_EACH_STATIC_TYPE(TYPENAME_DATA) - QTest::newRow("QMetaType::UnknownType") << QMetaType::UnknownType << static_cast<const char*>(0); + QTest::newRow("QMetaType::UnknownType") << int(QMetaType::UnknownType) << static_cast<const char*>(0); - QTest::newRow("Whity<double>") << static_cast<QMetaType::Type>(::qMetaTypeId<Whity<double> >()) << QString::fromLatin1("Whity<double>"); - QTest::newRow("Whity<int>") << static_cast<QMetaType::Type>(::qMetaTypeId<Whity<int> >()) << QString::fromLatin1("Whity<int>"); - QTest::newRow("Testspace::Foo") << static_cast<QMetaType::Type>(::qMetaTypeId<TestSpace::Foo>()) << QString::fromLatin1("TestSpace::Foo"); + QTest::newRow("Whity<double>") << ::qMetaTypeId<Whity<double> >() << QString::fromLatin1("Whity<double>"); + QTest::newRow("Whity<int>") << ::qMetaTypeId<Whity<int> >() << QString::fromLatin1("Whity<int>"); + QTest::newRow("Testspace::Foo") << ::qMetaTypeId<TestSpace::Foo>() << 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<int>") << static_cast<QMetaType::Type>(::qMetaTypeId<QList<int> >()) << QString::fromLatin1("QList<int>"); - QTest::newRow("QHash<int,int>") << static_cast<QMetaType::Type>(::qMetaTypeId<QHash<int, int> >()) << QString::fromLatin1("QHash<int,int>"); - QTest::newRow("QMap<int,int>") << static_cast<QMetaType::Type>(::qMetaTypeId<QMap<int, int> >()) << QString::fromLatin1("QMap<int,int>"); - QTest::newRow("QVector<QList<int>>") << static_cast<QMetaType::Type>(::qMetaTypeId<QVector<QList<int> > >()) << QString::fromLatin1("QVector<QList<int> >"); - QTest::newRow("QVector<QMap<int,int>>") << static_cast<QMetaType::Type>(::qMetaTypeId<QVector<QMap<int, int> > >()) << QString::fromLatin1("QVector<QMap<int,int> >"); + QTest::newRow("QList<int>") << ::qMetaTypeId<QList<int> >() << QString::fromLatin1("QList<int>"); + QTest::newRow("QHash<int,int>") << ::qMetaTypeId<QHash<int, int> >() << QString::fromLatin1("QHash<int,int>"); + QTest::newRow("QMap<int,int>") << ::qMetaTypeId<QMap<int, int> >() << QString::fromLatin1("QMap<int,int>"); + QTest::newRow("QVector<QList<int>>") << ::qMetaTypeId<QVector<QList<int> > >() << QString::fromLatin1("QVector<QList<int> >"); + QTest::newRow("QVector<QMap<int,int>>") << ::qMetaTypeId<QVector<QMap<int, int> > >() << QString::fromLatin1("QVector<QMap<int,int> >"); - QTest::newRow("CustomQObject*") << static_cast<QMetaType::Type>(::qMetaTypeId<CustomQObject*>()) << QString::fromLatin1("CustomQObject*"); - QTest::newRow("CustomGadget") << static_cast<QMetaType::Type>(::qMetaTypeId<CustomGadget>()) << QString::fromLatin1("CustomGadget"); - QTest::newRow("CustomQObject::CustomQEnum") << static_cast<QMetaType::Type>(::qMetaTypeId<CustomQObject::CustomQEnum>()) << QString::fromLatin1("CustomQObject::CustomQEnum"); - QTest::newRow("Qt::ArrowType") << static_cast<QMetaType::Type>(::qMetaTypeId<Qt::ArrowType>()) << QString::fromLatin1("Qt::ArrowType"); + QTest::newRow("CustomQObject*") << ::qMetaTypeId<CustomQObject*>() << QString::fromLatin1("CustomQObject*"); + QTest::newRow("CustomGadget") << ::qMetaTypeId<CustomGadget>() << QString::fromLatin1("CustomGadget"); + QTest::newRow("CustomQObject::CustomQEnum") << ::qMetaTypeId<CustomQObject::CustomQEnum>() << QString::fromLatin1("CustomQObject::CustomQEnum"); + QTest::newRow("Qt::ArrowType") << ::qMetaTypeId<Qt::ArrowType>() << 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<QMetaType::Type>("aType"); + QTest::addColumn<int>("aType"); QTest::addColumn<QByteArray>("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<QMetaType::QVariant> { void tst_QMetaType::create_data() { - QTest::addColumn<QMetaType::Type>("type"); + QTest::addColumn<int>("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<QMetaType::Type>("type"); + QTest::addColumn<int>("type"); QTest::addColumn<size_t>("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<RealType>::sizeOf); + QTest::newRow(#RealType) << int(QMetaType::MetaTypeName) << size_t(QTypeInfo<RealType>::sizeOf); FOR_EACH_CORE_METATYPE(ADD_METATYPE_TEST_ROW) #undef ADD_METATYPE_TEST_ROW - QTest::newRow("Whity<double>") << static_cast<QMetaType::Type>(::qMetaTypeId<Whity<double> >()) << sizeof(Whity<double>); -QTest::newRow("Whity<int>") << static_cast<QMetaType::Type>(::qMetaTypeId<Whity<int> >()) << sizeof(Whity<int>); - QTest::newRow("Testspace::Foo") << static_cast<QMetaType::Type>(::qMetaTypeId<TestSpace::Foo>()) << sizeof(TestSpace::Foo); + QTest::newRow("Whity<double>") << ::qMetaTypeId<Whity<double> >() << sizeof(Whity<double>); + QTest::newRow("Whity<int>") << ::qMetaTypeId<Whity<int> >() << sizeof(Whity<int>); + QTest::newRow("Testspace::Foo") << ::qMetaTypeId<TestSpace::Foo>() << 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)(); } |