From 90dc1f9204b8f44302b57392ba2fbfdc3653bdf2 Mon Sep 17 00:00:00 2001 From: Fabian Kosmale Date: Wed, 10 Mar 2021 11:42:41 +0100 Subject: [PATCH] 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 --- .../gui/kernel/qguimetatype/tst_qguimetatype.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/benchmarks/gui/kernel/qguimetatype/tst_qguimetatype.cpp b/tests/benchmarks/gui/kernel/qguimetatype/tst_qguimetatype.cpp index 7d6c1ef86d..6568307461 100644 --- a/tests/benchmarks/gui/kernel/qguimetatype/tst_qguimetatype.cpp +++ b/tests/benchmarks/gui/kernel/qguimetatype/tst_qguimetatype.cpp @@ -46,8 +46,11 @@ private: void tst_QGuiMetaType::constructableGuiTypes() { QTest::addColumn("typeId"); - for (int i = QMetaType::FirstGuiType; i <= QMetaType::LastGuiType; ++i) - QTest::newRow(QMetaType::typeName(i)) << i; + for (int i = QMetaType::FirstGuiType; i <= QMetaType::LastGuiType; ++i) { + QMetaType metaType(i); + if (metaType.isValid()) + QTest::newRow(QMetaType::typeName(i)) << i; + } }