summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks/corelib/kernel/qvariant
diff options
context:
space:
mode:
Diffstat (limited to 'tests/benchmarks/corelib/kernel/qvariant')
-rw-r--r--tests/benchmarks/corelib/kernel/qvariant/CMakeLists.txt4
-rw-r--r--tests/benchmarks/corelib/kernel/qvariant/tst_bench_qvariant.cpp (renamed from tests/benchmarks/corelib/kernel/qvariant/tst_qvariant.cpp)70
2 files changed, 36 insertions, 38 deletions
diff --git a/tests/benchmarks/corelib/kernel/qvariant/CMakeLists.txt b/tests/benchmarks/corelib/kernel/qvariant/CMakeLists.txt
index 418fd1da9f..83e7269ff0 100644
--- a/tests/benchmarks/corelib/kernel/qvariant/CMakeLists.txt
+++ b/tests/benchmarks/corelib/kernel/qvariant/CMakeLists.txt
@@ -1,12 +1,10 @@
-# Generated from qvariant.pro.
-
#####################################################################
## tst_bench_qvariant Binary:
#####################################################################
qt_internal_add_benchmark(tst_bench_qvariant
SOURCES
- tst_qvariant.cpp
+ tst_bench_qvariant.cpp
PUBLIC_LIBRARIES
Qt::Gui
Qt::Test
diff --git a/tests/benchmarks/corelib/kernel/qvariant/tst_qvariant.cpp b/tests/benchmarks/corelib/kernel/qvariant/tst_bench_qvariant.cpp
index f2618f7813..1e35cf85f9 100644
--- a/tests/benchmarks/corelib/kernel/qvariant/tst_qvariant.cpp
+++ b/tests/benchmarks/corelib/kernel/qvariant/tst_bench_qvariant.cpp
@@ -34,7 +34,7 @@
#define ITERATION_COUNT 1e5
-class tst_qvariant : public QObject
+class tst_QVariant : public QObject
{
Q_OBJECT
@@ -107,7 +107,7 @@ Q_DECLARE_TYPEINFO(SmallClass, Q_RELOCATABLE_TYPE);
QT_END_NAMESPACE
Q_DECLARE_METATYPE(SmallClass);
-void tst_qvariant::testBound()
+void tst_QVariant::testBound()
{
qreal d = qreal(.5);
QBENCHMARK {
@@ -148,7 +148,7 @@ void variantCreation<SmallClass>(SmallClass val)
}
template <>
-void variantCreation<tst_qvariant::ABenchmarkEnum>(tst_qvariant::ABenchmarkEnum val)
+void variantCreation<tst_QVariant::ABenchmarkEnum>(tst_QVariant::ABenchmarkEnum val)
{
QBENCHMARK {
for (int i = 0; i < ITERATION_COUNT; ++i) {
@@ -158,49 +158,49 @@ void variantCreation<tst_qvariant::ABenchmarkEnum>(tst_qvariant::ABenchmarkEnum
}
-void tst_qvariant::doubleVariantCreation()
+void tst_QVariant::doubleVariantCreation()
{
variantCreation<double>(0.0);
}
-void tst_qvariant::floatVariantCreation()
+void tst_QVariant::floatVariantCreation()
{
variantCreation<float>(0.0f);
}
-void tst_qvariant::rectVariantCreation()
+void tst_QVariant::rectVariantCreation()
{
variantCreation<QRect>(QRect(1, 2, 3, 4));
}
-void tst_qvariant::stringVariantCreation()
+void tst_QVariant::stringVariantCreation()
{
variantCreation<QString>(QString());
}
#ifdef QT_GUI_LIB
-void tst_qvariant::pixmapVariantCreation()
+void tst_QVariant::pixmapVariantCreation()
{
variantCreation<QPixmap>(QPixmap());
}
#endif
-void tst_qvariant::stringListVariantCreation()
+void tst_QVariant::stringListVariantCreation()
{
variantCreation<QStringList>(QStringList());
}
-void tst_qvariant::bigClassVariantCreation()
+void tst_QVariant::bigClassVariantCreation()
{
variantCreation<BigClass>(BigClass());
}
-void tst_qvariant::smallClassVariantCreation()
+void tst_QVariant::smallClassVariantCreation()
{
variantCreation<SmallClass>(SmallClass());
}
-void tst_qvariant::enumVariantCreation()
+void tst_QVariant::enumVariantCreation()
{
variantCreation<ABenchmarkEnum>(FirstEnumValue);
}
@@ -217,42 +217,42 @@ static void variantSetValue(T d)
}
}
-void tst_qvariant::doubleVariantSetValue()
+void tst_QVariant::doubleVariantSetValue()
{
variantSetValue<double>(0.0);
}
-void tst_qvariant::floatVariantSetValue()
+void tst_QVariant::floatVariantSetValue()
{
variantSetValue<float>(0.0f);
}
-void tst_qvariant::rectVariantSetValue()
+void tst_QVariant::rectVariantSetValue()
{
variantSetValue<QRect>(QRect());
}
-void tst_qvariant::stringVariantSetValue()
+void tst_QVariant::stringVariantSetValue()
{
variantSetValue<QString>(QString());
}
-void tst_qvariant::stringListVariantSetValue()
+void tst_QVariant::stringListVariantSetValue()
{
variantSetValue<QStringList>(QStringList());
}
-void tst_qvariant::bigClassVariantSetValue()
+void tst_QVariant::bigClassVariantSetValue()
{
variantSetValue<BigClass>(BigClass());
}
-void tst_qvariant::smallClassVariantSetValue()
+void tst_QVariant::smallClassVariantSetValue()
{
variantSetValue<SmallClass>(SmallClass());
}
-void tst_qvariant::enumVariantSetValue()
+void tst_QVariant::enumVariantSetValue()
{
variantSetValue<ABenchmarkEnum>(FirstEnumValue);
}
@@ -268,32 +268,32 @@ static void variantAssignment(T d)
}
}
-void tst_qvariant::doubleVariantAssignment()
+void tst_QVariant::doubleVariantAssignment()
{
variantAssignment<double>(0.0);
}
-void tst_qvariant::floatVariantAssignment()
+void tst_QVariant::floatVariantAssignment()
{
variantAssignment<float>(0.0f);
}
-void tst_qvariant::rectVariantAssignment()
+void tst_QVariant::rectVariantAssignment()
{
variantAssignment<QRect>(QRect());
}
-void tst_qvariant::stringVariantAssignment()
+void tst_QVariant::stringVariantAssignment()
{
variantAssignment<QString>(QString());
}
-void tst_qvariant::stringListVariantAssignment()
+void tst_QVariant::stringListVariantAssignment()
{
variantAssignment<QStringList>(QStringList());
}
-void tst_qvariant::doubleVariantValue()
+void tst_QVariant::doubleVariantValue()
{
QVariant v(0.0);
QBENCHMARK {
@@ -303,7 +303,7 @@ void tst_qvariant::doubleVariantValue()
}
}
-void tst_qvariant::floatVariantValue()
+void tst_QVariant::floatVariantValue()
{
QVariant v(0.0f);
QBENCHMARK {
@@ -313,7 +313,7 @@ void tst_qvariant::floatVariantValue()
}
}
-void tst_qvariant::rectVariantValue()
+void tst_QVariant::rectVariantValue()
{
QVariant v(QRect(1,2,3,4));
QBENCHMARK {
@@ -323,7 +323,7 @@ void tst_qvariant::rectVariantValue()
}
}
-void tst_qvariant::stringVariantValue()
+void tst_QVariant::stringVariantValue()
{
QVariant v = QString();
QBENCHMARK {
@@ -333,7 +333,7 @@ void tst_qvariant::stringVariantValue()
}
}
-void tst_qvariant::createCoreType_data()
+void tst_QVariant::createCoreType_data()
{
QTest::addColumn<int>("typeId");
for (int i = QMetaType::FirstCoreType; i <= QMetaType::LastCoreType; ++i) {
@@ -346,7 +346,7 @@ void tst_qvariant::createCoreType_data()
// QVariant. The purpose of this benchmark is to measure the overhead
// of creating (and destroying) a QVariant compared to creating the
// type directly.
-void tst_qvariant::createCoreType()
+void tst_QVariant::createCoreType()
{
QFETCH(int, typeId);
QBENCHMARK {
@@ -355,7 +355,7 @@ void tst_qvariant::createCoreType()
}
}
-void tst_qvariant::createCoreTypeCopy_data()
+void tst_QVariant::createCoreTypeCopy_data()
{
createCoreType_data();
}
@@ -364,7 +364,7 @@ void tst_qvariant::createCoreTypeCopy_data()
// QVariant. The purpose of this benchmark is to measure the overhead
// of creating (and destroying) a QVariant compared to creating the
// type directly.
-void tst_qvariant::createCoreTypeCopy()
+void tst_QVariant::createCoreTypeCopy()
{
QFETCH(int, typeId);
QMetaType metaType(typeId);
@@ -376,6 +376,6 @@ void tst_qvariant::createCoreTypeCopy()
}
}
-QTEST_MAIN(tst_qvariant)
+QTEST_MAIN(tst_QVariant)
-#include "tst_qvariant.moc"
+#include "tst_bench_qvariant.moc"