summaryrefslogtreecommitdiffstats
path: root/tests/auto/network/socket/platformsocketengine
diff options
context:
space:
mode:
authorJonas M. Gastal <jgastal@profusion.mobi>2012-05-04 10:18:39 -0300
committerQt by Nokia <qt-info@nokia.com>2012-05-21 13:00:27 +0200
commit2c790b251d9e3a30abe8ac63ab50f81c9c7631ce (patch)
treeee36d0b9fb5e51673314689f0f714a1d40854978 /tests/auto/network/socket/platformsocketengine
parent63ed8bf07e11a7be236494608e91150e7f084028 (diff)
Fallback to IPv4 when IPv6 is not present.
In tests when IPv6 is not present QSKIP IPv6 tests. Task-number: QTBUG-23660 Change-Id: I02abc7322d765a93cbf661e53c76257f03dca73e Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
Diffstat (limited to 'tests/auto/network/socket/platformsocketengine')
-rw-r--r--tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp b/tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp
index ffcc9cfc97..aa59c08c94 100644
--- a/tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp
+++ b/tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp
@@ -572,14 +572,16 @@ void tst_PlatformSocketEngine::bind()
QVERIFY(!binder3.bind(QHostAddress::AnyIPv4, 31180));
QVERIFY(binder3.error() == QAbstractSocket::AddressInUseError);
- PLATFORMSOCKETENGINE binder4;
- QVERIFY(binder4.initialize(QAbstractSocket::TcpSocket, QAbstractSocket::IPv6Protocol));
- QVERIFY(binder4.bind(QHostAddress::AnyIPv6, 31180));
-
- PLATFORMSOCKETENGINE binder5;
- QVERIFY(binder5.initialize(QAbstractSocket::TcpSocket, QAbstractSocket::IPv6Protocol));
- QVERIFY(!binder5.bind(QHostAddress::AnyIPv6, 31180));
- QVERIFY(binder5.error() == QAbstractSocket::AddressInUseError);
+ if (QtNetworkSettings::hasIPv6()) {
+ PLATFORMSOCKETENGINE binder4;
+ QVERIFY(binder4.initialize(QAbstractSocket::TcpSocket, QAbstractSocket::IPv6Protocol));
+ QVERIFY(binder4.bind(QHostAddress::AnyIPv6, 31180));
+
+ PLATFORMSOCKETENGINE binder5;
+ QVERIFY(binder5.initialize(QAbstractSocket::TcpSocket, QAbstractSocket::IPv6Protocol));
+ QVERIFY(!binder5.bind(QHostAddress::AnyIPv6, 31180));
+ QVERIFY(binder5.error() == QAbstractSocket::AddressInUseError);
+ }
PLATFORMSOCKETENGINE binder6;
QVERIFY(binder6.initialize(QAbstractSocket::TcpSocket, QAbstractSocket::AnyIPProtocol));