From 84e89c1e9e00d4fab576b876cfa80e92b5602982 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Wed, 12 Jun 2019 18:06:23 +0200 Subject: Convert uses of QTime as a timer to QElapsedTimer Change-Id: I2297f61efa5adf9ea5194c7f3ff68574cbcf452c Reviewed-by: Friedemann Kleint --- tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'tests/auto/network/socket/qtcpsocket') diff --git a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp index abe9845213..c500c6b3c3 100644 --- a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp +++ b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp @@ -66,7 +66,7 @@ #endif #include #include -#include +#include #include #include // RVCT compiles also unused inline methods @@ -237,7 +237,6 @@ private: qint64 bytesAvailable; qint64 expectedLength; bool readingBody; - QTime timer; QByteArray expectedReplyIMAP_cached; @@ -1518,7 +1517,7 @@ void tst_QTcpSocket::downloadBigFile() expectedLength = 0; readingBody = false; - QTime stopWatch; + QElapsedTimer stopWatch; stopWatch.start(); enterLoop(600); @@ -2482,7 +2481,7 @@ void tst_QTcpSocket::suddenRemoteDisconnect() QEventLoop loop; connect(&serverProcess, SIGNAL(finished(int)), &loop, SLOT(quit())); connect(&clientProcess, SIGNAL(finished(int)), &loop, SLOT(quit())); - QTime stopWatch; + QElapsedTimer stopWatch; stopWatch.start(); QTimer::singleShot(20000, &loop, SLOT(quit())); @@ -2522,7 +2521,7 @@ void tst_QTcpSocket::connectToMultiIP() // rationale: this domain resolves to 3 A-records, 2 of them are // invalid. QTcpSocket should never spend more than 30 seconds per IP, and // 30s*2 = 60s. - QTime stopWatch; + QElapsedTimer stopWatch; stopWatch.start(); socket->connectToHost("multi.dev.qt-project.org", 80); QVERIFY(socket->waitForConnected(60500)); @@ -2714,7 +2713,7 @@ void tst_QTcpSocket::taskQtBug5799ConnectionErrorWaitForConnected() QTcpSocket socket; socket.connectToHost(QtNetworkSettings::httpServerName(), 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"); -- cgit v1.2.3