Skip untestable interfaces in QTcpSocket::bind autotest
authorShane Kearns <shane.kearns@accenture.com>
Fri, 2 Dec 2011 11:10:02 +0000 (11:10 +0000)
committerQt by Nokia <qt-info@nokia.com>
Tue, 6 Dec 2011 10:57:11 +0000 (11:57 +0100)
bind() test failed if there is an autoconfigured IPv4 address.
e.g. bluetooth adaptor that is not attached to a network.
Or WLAN adaptor in peer-peer mode.
- solved by skipping the autoconfigured IPv4 addresses in the same way
  as IPv6 addresses are already skipped

bind() test fails for proxy
- skipped, QTBUG-22964 created

Change-Id: I9a799ae8db421783f474e97cf876d6e265516397
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp

index cb5b3df..98ce112 100644 (file)
@@ -489,7 +489,8 @@ void tst_QTcpSocket::bind_data()
             continue;
 
         foreach (const QNetworkAddressEntry &entry, interface.addressEntries()) {
-            if (entry.ip().isInSubnet(QHostAddress::parseSubnet("fe80::/10")))
+            if (entry.ip().isInSubnet(QHostAddress::parseSubnet("fe80::/10"))
+                || entry.ip().isInSubnet(QHostAddress::parseSubnet("169.254/16")))
                 continue; // link-local bind will fail, at least on Linux, so skip it.
 
             QString ip(entry.ip().toString());
@@ -511,6 +512,9 @@ void tst_QTcpSocket::bind_data()
 
 void tst_QTcpSocket::bind()
 {
+    QFETCH_GLOBAL(bool, setProxy);
+    if (setProxy)
+        QSKIP("QTBUG-22964");
     QFETCH(QString, stringAddr);
     QFETCH(bool, successExpected);
     QFETCH(QString, stringExpectedLocalAddress);