summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMartin Petersson <martin.petersson@nokia.com>2011-05-20 08:04:18 (GMT)
committerMartin Petersson <martin.petersson@nokia.com>2011-05-20 08:10:49 (GMT)
commit0ccf01368adcabbb25958a55976083f72116a2d5 (patch)
treecfca5487ee8b9fd5a1b7f90941b8255a148b0493 /tests
parentc8a3c427e96ee11907592f5c7f72046795c027ed (diff)
downloadQt-0ccf01368adcabbb25958a55976083f72116a2d5.zip
Qt-0ccf01368adcabbb25958a55976083f72116a2d5.tar.gz
Qt-0ccf01368adcabbb25958a55976083f72116a2d5.tar.bz2
tst_qhostinfo: Fix IPv6 lookup detection on Windows.
Moved the QTcpServer test to init winsock before we use getaddrinfo. Reviewed-by: Shane Kearns
Diffstat (limited to 'tests')
-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 af0631e..7657035 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;