summaryrefslogtreecommitdiffstats
path: root/tests/auto/other
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2015-03-31 10:03:31 +0200
committerLiang Qi <liang.qi@theqtcompany.com>2015-03-31 10:03:31 +0200
commitce9519593a0b3deb99d1dd2529770f7e9fffef92 (patch)
treec9bca05230dd68f49494240ae930bad1fe0c5956 /tests/auto/other
parent509f77cca28aa3edea5523c5869bae4412ed2ccc (diff)
parent7baaec17edb06634f1d6235a55c7adbd112cba3e (diff)
Merge remote-tracking branch 'origin/5.4' into 5.5
Conflicts: mkspecs/android-g++/qmake.conf qmake/generators/unix/unixmake2.cpp src/gui/image/qimage_conversions.cpp Change-Id: Ib76264b8c2d29a0228438ec02bd97d4b97545be0
Diffstat (limited to 'tests/auto/other')
-rw-r--r--tests/auto/other/networkselftest/networkselftest.pro2
-rw-r--r--tests/auto/other/networkselftest/tst_networkselftest.cpp11
2 files changed, 8 insertions, 5 deletions
diff --git a/tests/auto/other/networkselftest/networkselftest.pro b/tests/auto/other/networkselftest/networkselftest.pro
index c8b870128d..22208e02fb 100644
--- a/tests/auto/other/networkselftest/networkselftest.pro
+++ b/tests/auto/other/networkselftest/networkselftest.pro
@@ -2,7 +2,7 @@ CONFIG += testcase
TARGET = tst_networkselftest
SOURCES += tst_networkselftest.cpp
-QT = core network testlib
+QT = core core-private network testlib
win32:CONFIG += insignificant_test # QTBUG-27571
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/other/networkselftest/tst_networkselftest.cpp b/tests/auto/other/networkselftest/tst_networkselftest.cpp
index 761b5c28d7..5612260cca 100644
--- a/tests/auto/other/networkselftest/tst_networkselftest.cpp
+++ b/tests/auto/other/networkselftest/tst_networkselftest.cpp
@@ -34,6 +34,7 @@
#include <QtTest/QtTest>
#include <QtNetwork/QtNetwork>
#include <QtCore/QDateTime>
+#include <QtCore/private/qiodevice_p.h>
#ifndef QT_NO_BEARERMANAGEMENT
#include <QtNetwork/qnetworkconfigmanager.h>
@@ -171,10 +172,11 @@ static bool doSocketRead(QTcpSocket *socket, int minBytesAvailable, int timeout
forever {
if (socket->bytesAvailable() >= minBytesAvailable)
return true;
+ timeout = qt_subtract_from_timeout(timeout, timer.elapsed());
if (socket->state() == QAbstractSocket::UnconnectedState
- || timer.elapsed() >= timeout)
+ || timeout == 0)
return false;
- if (!socket->waitForReadyRead(timeout - timer.elapsed()))
+ if (!socket->waitForReadyRead(timeout))
return false;
}
}
@@ -202,10 +204,11 @@ static bool doSocketFlush(QTcpSocket *socket, int timeout = 4000)
#endif
)
return true;
+ timeout = qt_subtract_from_timeout(timeout, timer.elapsed());
if (socket->state() == QAbstractSocket::UnconnectedState
- || timer.elapsed() >= timeout)
+ || timeout == 0)
return false;
- if (!socket->waitForBytesWritten(timeout - timer.elapsed()))
+ if (!socket->waitForBytesWritten(timeout))
return false;
}
}