diff options
Diffstat (limited to 'tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp')
-rw-r--r-- | tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp | 18 |
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)); |