Fix QMetaType benchmark
The benchmark used to crash because QMetaType::typeName would return an empty string, which is not a legal value for newRow. Change-Id: I9e6c6c1cf153943bfa21181cd2cca596a7943ea0 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 1316af2f3ed7861d0955793261a18f8ebf237f6f) Fixes: QTBUG-91711
This commit is contained in:
parent
0f7d433d6d
commit
3858d1e913
@ -248,9 +248,11 @@ void tst_QMetaType::isRegisteredNotRegistered()
|
|||||||
void tst_QMetaType::constructInPlace_data()
|
void tst_QMetaType::constructInPlace_data()
|
||||||
{
|
{
|
||||||
QTest::addColumn<int>("typeId");
|
QTest::addColumn<int>("typeId");
|
||||||
for (int i = QMetaType::FirstCoreType; i <= QMetaType::LastCoreType; ++i)
|
for (int i = QMetaType::FirstCoreType; i <= QMetaType::LastCoreType; ++i) {
|
||||||
if (i != QMetaType::Void)
|
auto name = QMetaType::typeName(i);
|
||||||
QTest::newRow(QMetaType::typeName(i)) << i;
|
if (name && i != QMetaType::Void)
|
||||||
|
QTest::newRow(name) << i;
|
||||||
|
}
|
||||||
|
|
||||||
QTest::newRow("custom") << qMetaTypeId<BigClass>();
|
QTest::newRow("custom") << qMetaTypeId<BigClass>();
|
||||||
// GUI types are tested in tst_QGuiMetaType.
|
// GUI types are tested in tst_QGuiMetaType.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user