diff options
author | Martin Petersson <martin.petersson@nokia.com> | 2011-05-20 10:04:18 +0200 |
---|---|---|
committer | Martin Petersson <martin.petersson@nokia.com> | 2011-05-20 10:52:52 +0200 |
commit | df2d6753acff2dde79f99effc1a779f5c7f0a2c0 (patch) | |
tree | 445107e8829001e1087503af4f86445f6f38777b /tests | |
parent | 0ebe0414d23c15cb21ebf212bb8b82d66b68c73b (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')
-rw-r--r-- | tests/auto/qhostinfo/tst_qhostinfo.cpp | 14 |
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; |