summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks/corelib/tools/qalgorithms/tst_qalgorithms.cpp
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@qt.io>2020-06-22 16:30:54 +0200
committerJarek Kobus <jaroslaw.kobus@qt.io>2020-06-25 10:13:31 +0200
commit74dc89de3ed45ad217fdb003f663144e71ef01f8 (patch)
tree96e56d9e74848da40cb2e7868e0024fa8212ff89 /tests/benchmarks/corelib/tools/qalgorithms/tst_qalgorithms.cpp
parentd1612610e650ffd7f2fbdef535c431647f57f0ac (diff)
Use QList instead of QVector in benchmarks tests
Task-number: QTBUG-84469 Change-Id: Id61d6036067da0bcd0811b1b97df5f1334007b7e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests/benchmarks/corelib/tools/qalgorithms/tst_qalgorithms.cpp')
-rw-r--r--tests/benchmarks/corelib/tools/qalgorithms/tst_qalgorithms.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/benchmarks/corelib/tools/qalgorithms/tst_qalgorithms.cpp b/tests/benchmarks/corelib/tools/qalgorithms/tst_qalgorithms.cpp
index a4ad3a08a8..ea116a4006 100644
--- a/tests/benchmarks/corelib/tools/qalgorithms/tst_qalgorithms.cpp
+++ b/tests/benchmarks/corelib/tools/qalgorithms/tst_qalgorithms.cpp
@@ -36,7 +36,7 @@
#include <qalgorithms.h>
#include <QStringList>
#include <QString>
-#include <QVector>
+#include <QList>
using namespace std;
@@ -51,10 +51,10 @@ private slots:
void sort();
};
-template <typename DataType>
-QVector<DataType> generateData(QString dataSetType, const int length)
+template<typename DataType>
+QList<DataType> generateData(QString dataSetType, const int length)
{
- QVector<DataType> container;
+ QList<DataType> container;
if (dataSetType == "Random") {
for (int i = 0; i < length; ++i)
container.append(QRandomGenerator::global()->generate());
@@ -88,7 +88,7 @@ QVector<DataType> generateData(QString dataSetType, const int length)
void tst_QAlgorithms::stableSort_data()
{
const int dataSize = 5000;
- QTest::addColumn<QVector<int> >("unsorted");
+ QTest::addColumn<QList<int>>("unsorted");
QTest::newRow("Equal") << (generateData<int>("Equal", dataSize));
QTest::newRow("Ascending") << (generateData<int>("Ascending", dataSize));
QTest::newRow("Descending") << (generateData<int>("Descending", dataSize));
@@ -98,10 +98,10 @@ void tst_QAlgorithms::stableSort_data()
void tst_QAlgorithms::stableSort()
{
- QFETCH(QVector<int>, unsorted);
+ QFETCH(QList<int>, unsorted);
QBENCHMARK {
- QVector<int> sorted = unsorted;
+ QList<int> sorted = unsorted;
qStableSort(sorted.begin(), sorted.end());
}
}
@@ -113,10 +113,10 @@ void tst_QAlgorithms::sort_data()
void tst_QAlgorithms::sort()
{
- QFETCH(QVector<int>, unsorted);
+ QFETCH(QList<int>, unsorted);
QBENCHMARK {
- QVector<int> sorted = unsorted;
+ QList<int> sorted = unsorted;
qSort(sorted.begin(), sorted.end());
}
}