tst_qguivariant benchmark: Only use valid QMetaTypes
Otherewise, we hit an assertion because the name is empty. Fixes: QTBUG-91709 Change-Id: I03a530d64ea8dead3efc5fcb8c00909388a387d0 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 3e46c22d943233554be8897ddda191cdfdb5e44e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
6498e6f76d
commit
7dfe36a9a0
@ -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