From 9138890bd60d2b07bed5e132306f9b3acd748343 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Fri, 2 Dec 2011 11:14:47 +0000 Subject: 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 --- tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/auto/network/socket') 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); -- cgit v1.2.3