summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks/corelib
diff options
context:
space:
mode:
Diffstat (limited to 'tests/benchmarks/corelib')
-rw-r--r--tests/benchmarks/corelib/tools/qalgorithms/tst_qalgorithms.cpp2
-rw-r--r--tests/benchmarks/corelib/tools/qcryptographichash/main.cpp6
2 files changed, 4 insertions, 4 deletions
diff --git a/tests/benchmarks/corelib/tools/qalgorithms/tst_qalgorithms.cpp b/tests/benchmarks/corelib/tools/qalgorithms/tst_qalgorithms.cpp
index 11e559a298..a4ad3a08a8 100644
--- a/tests/benchmarks/corelib/tools/qalgorithms/tst_qalgorithms.cpp
+++ b/tests/benchmarks/corelib/tools/qalgorithms/tst_qalgorithms.cpp
@@ -57,7 +57,7 @@ QVector<DataType> generateData(QString dataSetType, const int length)
QVector<DataType> container;
if (dataSetType == "Random") {
for (int i = 0; i < length; ++i)
- container.append(rand());
+ container.append(QRandomGenerator::global()->generate());
} else if (dataSetType == "Ascending") {
for (int i = 0; i < length; ++i)
container.append(i);
diff --git a/tests/benchmarks/corelib/tools/qcryptographichash/main.cpp b/tests/benchmarks/corelib/tools/qcryptographichash/main.cpp
index 507e2af708..1d414161d1 100644
--- a/tests/benchmarks/corelib/tools/qcryptographichash/main.cpp
+++ b/tests/benchmarks/corelib/tools/qcryptographichash/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 Intel Corporation.
+** Copyright (C) 2017 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -29,6 +29,7 @@
#include <QByteArray>
#include <QCryptographicHash>
#include <QFile>
+#include <QRandomGenerator>
#include <QString>
#include <QtTest>
@@ -102,9 +103,8 @@ tst_bench_QCryptographicHash::tst_bench_QCryptographicHash()
} else
#endif
{
- qsrand(time(NULL));
for (int i = 0; i < MaxBlockSize; ++i)
- blockOfData[i] = qrand();
+ blockOfData[i] = QRandomGenerator::global()->generate();
}
}