Skip untestable interfaces in QTcpSocket::bind autotest

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>
This commit is contained in:
Shane Kearns 2011-12-02 11:10:02 +00:00 committed by Qt by Nokia
parent 4d98b83c17
commit 7abd5d950d

View 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);