summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/installer/registerfiletypeoperation/tst_registerfiletypeoperation.cpp3
-rw-r--r--tests/auto/installer/replaceoperation/tst_replaceoperation.cpp3
2 files changed, 4 insertions, 2 deletions
diff --git a/tests/auto/installer/registerfiletypeoperation/tst_registerfiletypeoperation.cpp b/tests/auto/installer/registerfiletypeoperation/tst_registerfiletypeoperation.cpp
index bbe391a0a..4d14a2753 100644
--- a/tests/auto/installer/registerfiletypeoperation/tst_registerfiletypeoperation.cpp
+++ b/tests/auto/installer/registerfiletypeoperation/tst_registerfiletypeoperation.cpp
@@ -37,6 +37,7 @@
#include <QTextStream>
#include <QSettings>
#include <QtGlobal>
+#include <QRandomGenerator>
#include "qsettingswrapper.h"
@@ -73,7 +74,7 @@ private slots:
const QString possible = "abcdefghijklmnopqrstuvwxyz0123456789";
qsrand(QTime::currentTime().msec());
for (int i = 0; i < 5; i++) {
- int index = qrand() % possible.length();
+ int index = QRandomGenerator::global()->generate() % possible.length();
QChar nextChar = possible.at(index);
randomString.append(nextChar);
diff --git a/tests/auto/installer/replaceoperation/tst_replaceoperation.cpp b/tests/auto/installer/replaceoperation/tst_replaceoperation.cpp
index 88dc2011b..33bd2b6c1 100644
--- a/tests/auto/installer/replaceoperation/tst_replaceoperation.cpp
+++ b/tests/auto/installer/replaceoperation/tst_replaceoperation.cpp
@@ -34,6 +34,7 @@
#include <QDir>
#include <QFile>
#include <QTest>
+#include <QRandomGenerator>
using namespace KDUpdater;
using namespace QInstaller;
@@ -46,7 +47,7 @@ private slots:
void initTestCase()
{
m_testDirectory = QInstaller::generateTemporaryFileName();
- m_testFilePath = m_testDirectory + "/test." + QString::number(qrand() % 1000);
+ m_testFilePath = m_testDirectory + "/test." + QString::number(QRandomGenerator::global()->generate() % 1000);
}
void testWrongArguments()