tst_bench_qguimetatype: only consider valid metatypes

Otherwise the benchmark crashes as the data tag for the row would be
empty.

Fixes: QTBUG-91708
Pick-to: 6.0 6.1
Change-Id: I484ded5b8670571b80012e64d67846d3b8db5320
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
Fabian Kosmale 2021-03-10 11:42:41 +01:00
parent 153716a914
commit 90dc1f9204

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()