summaryrefslogtreecommitdiffstats
path: root/tests/auto/network/socket
diff options
context:
space:
mode:
authorShane Kearns <shane.kearns@accenture.com>2011-12-02 11:14:47 +0000
committerQt by Nokia <qt-info@nokia.com>2011-12-09 01:01:01 +0100
commit9138890bd60d2b07bed5e132306f9b3acd748343 (patch)
tree7f2265f49bdd3c9ce6424a0e2b9254634b1076af /tests/auto/network/socket
parentf7d11b216a47db833dd935cc30fb963be37fc761 (diff)
Fix failing setSocketDescriptor test in QTcpSocket
setSocketDescriptor fails because socket is in the wrong state. This is timing dependent, if qt-test-server is still in the DNS cache then the test failed. - clear the DNS cache to avoid the host lookup state being skipped. Change-Id: If159d514b1aa9b62a4834f6352d5e7b0a00a5724 Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
Diffstat (limited to 'tests/auto/network/socket')
-rw-r--r--tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp
index 98ce112a9e..b50a427dc3 100644
--- a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp
+++ b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp
@@ -583,6 +583,7 @@ void tst_QTcpSocket::setSocketDescriptor()
QVERIFY(socket->setSocketDescriptor(sock, QTcpSocket::UnconnectedState));
QCOMPARE(socket->socketDescriptor(), (int)sock);
+ qt_qhostinfo_clear_cache(); //avoid the HostLookupState being skipped due to address being in cache from previous test.
socket->connectToHost(QtNetworkSettings::serverName(), 143);
QCOMPARE(socket->state(), QTcpSocket::HostLookupState);
QCOMPARE(socket->socketDescriptor(), (int)sock);