diff --git a/tests/benchmarks/corelib/kernel/qmetatype/tst_qmetatype.cpp b/tests/benchmarks/corelib/kernel/qmetatype/tst_qmetatype.cpp index a3cdd38e560..c80a946366d 100644 --- a/tests/benchmarks/corelib/kernel/qmetatype/tst_qmetatype.cpp +++ b/tests/benchmarks/corelib/kernel/qmetatype/tst_qmetatype.cpp @@ -77,6 +77,9 @@ private slots: void constructCoreTypeCopy_data(); void constructCoreTypeCopy(); + void constructCustomType_data(); + void constructCustomType(); + void constructInPlace_data(); void constructInPlace(); void constructInPlaceCopy_data(); @@ -309,6 +312,24 @@ void tst_QMetaType::constructCoreTypeCopy() } } +void tst_QMetaType::constructCustomType_data() +{ + QTest::addColumn("typeId"); + + QTest::newRow("BigClass") << qMetaTypeId(); +} + +void tst_QMetaType::constructCustomType() +{ + QFETCH(int, typeId); + QBENCHMARK { + for (int i = 0; i < 100000; ++i) { + void *data = QMetaType::create(typeId, (void *)0); + QMetaType::destroy(typeId, data); + } + } +} + void tst_QMetaType::constructInPlace_data() { constructCoreType_data();