tst_qguivariant benchmark: Only use valid QMetaTypes
Otherewise, we hit an assertion because the name is empty. Fixes: QTBUG-91709 Pick-to: 6.0 6.1 Change-Id: I03a530d64ea8dead3efc5fcb8c00909388a387d0 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
parent
90dc1f9204
commit
3e46c22d94
@ -57,8 +57,11 @@ tst_QGuiVariant::~tst_QGuiVariant()
|
|||||||
void tst_QGuiVariant::createGuiType_data()
|
void tst_QGuiVariant::createGuiType_data()
|
||||||
{
|
{
|
||||||
QTest::addColumn<int>("typeId");
|
QTest::addColumn<int>("typeId");
|
||||||
for (int i = QMetaType::FirstGuiType; i <= QMetaType::LastGuiType; ++i)
|
for (int i = QMetaType::FirstGuiType; i <= QMetaType::LastGuiType; ++i) {
|
||||||
QTest::newRow(QMetaType::typeName(i)) << 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
|
// Tests how fast a Qt GUI type can be default-constructed by a
|
||||||
|
Loading…
x
Reference in New Issue
Block a user