summaryrefslogtreecommitdiffstats
path: root/tests/auto/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-11-21 14:34:31 +0100
committerLiang Qi <liang.qi@qt.io>2017-11-23 09:36:03 +0100
commit153e8b49adfe210cb00490284a14c94c08e03c3f (patch)
tree59d9522d6dc96215cc2cb1d19b3e8a0e580bcb41 /tests/auto/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp
parentef7c0594bf9e41813c9c841e00c3a52269d363f5 (diff)
parenta4113d0c644edba1c39d9d268a259e95ae51c61e (diff)
Merge remote-tracking branch 'origin/5.10' into dev
Conflicts: src/network/access/qhttp2protocolhandler_p.h src/network/kernel/kernel.pri src/network/ssl/qsslkey_qt.cpp src/plugins/platforms/cocoa/qcocoascreen.mm src/plugins/platforms/windows/accessible/iaccessible2.cpp src/plugins/platforms/windows/accessible/iaccessible2.h src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.h src/widgets/widgets/qmenu_p.h tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp tests/auto/other/qaccessibility/tst_qaccessibility.cpp tests/auto/testlib/selftests/expected_cmptest.lightxml tests/auto/testlib/selftests/expected_cmptest.teamcity tests/auto/testlib/selftests/expected_cmptest.txt tests/auto/testlib/selftests/expected_cmptest.xml Done-with: Edward Welbourne <edward.welbourne@qt.io> Change-Id: I4217cc7d840cbae3e3dd28574741544469c4c6b9
Diffstat (limited to 'tests/auto/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp')
-rw-r--r--tests/auto/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/auto/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp b/tests/auto/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp
index e996347a9a..856033fb63 100644
--- a/tests/auto/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp
+++ b/tests/auto/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp
@@ -30,6 +30,7 @@
#include <QtTest/QtTest>
#include <QtNetwork/QtNetwork>
#include <qnetworkdiskcache.h>
+#include <qrandom.h>
#include <algorithm>
@@ -693,25 +694,25 @@ public:
if (write) {
QNetworkCacheMetaData m;
- if (qrand() % 2 == 0)
+ if (QRandomGenerator::global()->bounded(2) == 0)
m = metaData;
else
m = metaData2;
- if (qrand() % 20 == 1) {
+ if (QRandomGenerator::global()->bounded(20) == 1) {
//qDebug() << "write update";
cache.updateMetaData(m);
continue;
}
QIODevice *device = cache.prepare(m);
- if (qrand() % 20 == 1) {
+ if (QRandomGenerator::global()->bounded(20) == 1) {
//qDebug() << "write remove";
cache.remove(url);
continue;
}
QVERIFY(device);
- if (qrand() % 2 == 0)
+ if (QRandomGenerator::global()->bounded(2) == 0)
device->write(longString);
else
device->write(longString2);
@@ -740,9 +741,9 @@ public:
delete d;
}
}
- if (qrand() % 5 == 1)
+ if (QRandomGenerator::global()->bounded(5) == 1)
cache.remove(url);
- if (qrand() % 5 == 1)
+ if (QRandomGenerator::global()->bounded(5) == 1)
cache.clear();
sleep(0);
}
@@ -791,7 +792,6 @@ void tst_QNetworkDiskCache::sync()
return;
QTime midnight(0, 0, 0);
- qsrand(midnight.secsTo(QTime::currentTime()));
Runner reader(tempDir.path());
reader.dt = QDateTime::currentDateTime();
reader.write = false;