summaryrefslogtreecommitdiffstats
path: root/tests/auto/other/networkselftest/tst_networkselftest.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2019-06-26 11:32:55 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2019-06-26 11:33:19 +0200
commit7810209ba32fcebfa90b081670595daaa5333a78 (patch)
tree98410d5cc7d9d762bbde0cb4eae8041aa6e2e542 /tests/auto/other/networkselftest/tst_networkselftest.cpp
parent6f2eabb54e3f827ebd2b90f68144b86342933869 (diff)
parent88625709058b386ee74cca536c6c5556159c99fa (diff)
Merge remote-tracking branch 'origin/dev' into wip/qt6
Diffstat (limited to 'tests/auto/other/networkselftest/tst_networkselftest.cpp')
-rw-r--r--tests/auto/other/networkselftest/tst_networkselftest.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/auto/other/networkselftest/tst_networkselftest.cpp b/tests/auto/other/networkselftest/tst_networkselftest.cpp
index dc353d2090..1b125d8825 100644
--- a/tests/auto/other/networkselftest/tst_networkselftest.cpp
+++ b/tests/auto/other/networkselftest/tst_networkselftest.cpp
@@ -29,6 +29,7 @@
#include <QtTest/QtTest>
#include <QtNetwork/QtNetwork>
#include <QtCore/QDateTime>
+#include <QtCore/QElapsedTimer>
#include <QtCore/QTextStream>
#include <QtCore/QRandomGenerator>
#include <QtCore/QStandardPaths>
@@ -195,7 +196,7 @@ static bool doSocketFlush(QTcpSocket *socket, int timeout = 4000)
#ifndef QT_NO_SSL
QSslSocket *sslSocket = qobject_cast<QSslSocket *>(socket);
#endif
- QTime timer;
+ QElapsedTimer timer;
timer.start();
int t = timeout;
forever {
@@ -421,7 +422,7 @@ void tst_NetworkSelfTest::serverReachability()
QTcpSocket socket;
socket.connectToHost(QtNetworkSettings::serverName(), 12346);
- QTime timer;
+ QElapsedTimer timer;
timer.start();
socket.waitForConnected(10000);
QVERIFY2(timer.elapsed() < 9900, "Connection to closed port timed out instead of refusing, something is wrong");