summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/benchmarks/corelib/kernel/qvariant/tst_qvariant.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/benchmarks/corelib/kernel/qvariant/tst_qvariant.cpp b/tests/benchmarks/corelib/kernel/qvariant/tst_qvariant.cpp
index d51b1e7a44..9664143608 100644
--- a/tests/benchmarks/corelib/kernel/qvariant/tst_qvariant.cpp
+++ b/tests/benchmarks/corelib/kernel/qvariant/tst_qvariant.cpp
@@ -336,8 +336,10 @@ void tst_qvariant::stringVariantValue()
void tst_qvariant::createCoreType_data()
{
QTest::addColumn<int>("typeId");
- for (int i = QMetaType::FirstCoreType; i <= QMetaType::LastCoreType; ++i)
- QTest::newRow(QMetaType::typeName(i)) << i;
+ for (int i = QMetaType::FirstCoreType; i <= QMetaType::LastCoreType; ++i) {
+ if (QMetaType::typeName(i)) // QMetaType(27) does not exist
+ QTest::newRow(QMetaType::typeName(i)) << i;
+ }
}
// Tests how fast a Qt core type can be default-constructed by a
@@ -365,11 +367,12 @@ void tst_qvariant::createCoreTypeCopy_data()
void tst_qvariant::createCoreTypeCopy()
{
QFETCH(int, typeId);
- QVariant other(typeId);
+ QMetaType metaType(typeId);
+ QVariant other(metaType);
const void *copy = other.constData();
QBENCHMARK {
for (int i = 0; i < ITERATION_COUNT; ++i)
- QVariant(QMetaType(typeId), copy);
+ QVariant(metaType, copy);
}
}