summaryrefslogtreecommitdiffstats
path: root/tests/auto/qhostinfo
diff options
context:
space:
mode:
authorMartin Petersson <martin.petersson@nokia.com>2011-05-20 10:04:18 +0200
committerMartin Petersson <martin.petersson@nokia.com>2011-05-20 10:52:52 +0200
commitdf2d6753acff2dde79f99effc1a779f5c7f0a2c0 (patch)
tree445107e8829001e1087503af4f86445f6f38777b /tests/auto/qhostinfo
parent0ebe0414d23c15cb21ebf212bb8b82d66b68c73b (diff)
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)
Diffstat (limited to 'tests/auto/qhostinfo')
-rw-r--r--tests/auto/qhostinfo/tst_qhostinfo.cpp14
1 files changed, 7 insertions, 7 deletions
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<bool>("cache");
QTest::newRow("WithCache") << true;