From df2d6753acff2dde79f99effc1a779f5c7f0a2c0 Mon Sep 17 00:00:00 2001 From: Martin Petersson Date: Fri, 20 May 2011 10:04:18 +0200 Subject: tst_qhostinfo: Fix IPv6 lookup detection on Windows. Moved the QTcpServer test to init winsock before we use getaddrinfo. Reviewed-by: Shane Kearns (cherry picked from commit 0ccf01368adcabbb25958a55976083f72116a2d5) --- tests/auto/qhostinfo/tst_qhostinfo.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'tests/auto/qhostinfo') diff --git a/tests/auto/qhostinfo/tst_qhostinfo.cpp b/tests/auto/qhostinfo/tst_qhostinfo.cpp index af0631e1f5..7657035a37 100644 --- a/tests/auto/qhostinfo/tst_qhostinfo.cpp +++ b/tests/auto/qhostinfo/tst_qhostinfo.cpp @@ -213,6 +213,13 @@ void tst_QHostInfo::initTestCase() #else ipv6Available = false; ipv6LookupsAvailable = false; + + QTcpServer server; + if (server.listen(QHostAddress("::1"))) { + // We have IPv6 support + ipv6Available = true; + } + #if !defined(QT_NO_GETADDRINFO) // check if the system getaddrinfo can do IPv6 lookups struct addrinfo hint, *result = 0; @@ -235,13 +242,6 @@ void tst_QHostInfo::initTestCase() #endif #endif - QTcpServer server; - if (server.listen(QHostAddress("::1"))) { - // We have IPv6 support - ipv6Available = true; - } - - // run each testcase with and without test enabled QTest::addColumn("cache"); QTest::newRow("WithCache") << true; -- cgit v1.2.3