Merge "tst_qguivariant benchmark: Only use valid QMetaTypes"

This commit is contained in:
Fabian Kosmale 2021-03-10 13:43:47 +01:00 committed by Qt CI Bot
commit 346d30144a
2 changed files with 10 additions and 4 deletions

View File

@ -46,9 +46,12 @@ private:
void tst_QGuiMetaType::constructableGuiTypes()
{
QTest::addColumn<int>("typeId");
for (int i = QMetaType::FirstGuiType; i <= QMetaType::LastGuiType; ++i)
for (int i = QMetaType::FirstGuiType; i <= QMetaType::LastGuiType; ++i) {
QMetaType metaType(i);
if (metaType.isValid())
QTest::newRow(QMetaType::typeName(i)) << i;
}
}
void tst_QGuiMetaType::constructInPlace_data()

View File

@ -57,9 +57,12 @@ tst_QGuiVariant::~tst_QGuiVariant()
void tst_QGuiVariant::createGuiType_data()
{
QTest::addColumn<int>("typeId");
for (int i = QMetaType::FirstGuiType; i <= QMetaType::LastGuiType; ++i)
for (int i = QMetaType::FirstGuiType; i <= QMetaType::LastGuiType; ++i) {
QMetaType metaType(i);
if (metaType.isValid())
QTest::newRow(QMetaType::typeName(i)) << i;
}
}
// Tests how fast a Qt GUI type can be default-constructed by a
// QVariant. The purpose of this benchmark is to measure the overhead