Skip UDP parts of tst_qnetworkinterface if UDP sockets not enabled
Task-number: QTBUG-136101 Pick-to: 6.8 Change-Id: Ib3be9ae7c3a261c606cf242a15279491304de6b6 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Mate Barany <mate.barany@qt.io> (cherry picked from commit cdeb245340b2f148e888ee28c215f60c80d822e0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
42dd3bc013
commit
bae42278a0
@ -8,7 +8,9 @@
|
|||||||
|
|
||||||
#include <qcoreapplication.h>
|
#include <qcoreapplication.h>
|
||||||
#include <qnetworkinterface.h>
|
#include <qnetworkinterface.h>
|
||||||
|
#if QT_CONFIG(udpsocket)
|
||||||
#include <qudpsocket.h>
|
#include <qudpsocket.h>
|
||||||
|
#endif
|
||||||
#include "../../../network-settings.h"
|
#include "../../../network-settings.h"
|
||||||
|
|
||||||
#include <private/qtnetwork-config_p.h>
|
#include <private/qtnetwork-config_p.h>
|
||||||
@ -223,6 +225,9 @@ void tst_QNetworkInterface::localAddress_data()
|
|||||||
|
|
||||||
void tst_QNetworkInterface::localAddress()
|
void tst_QNetworkInterface::localAddress()
|
||||||
{
|
{
|
||||||
|
#if !QT_CONFIG(udpsocket)
|
||||||
|
QSKIP("UDP socket support not built in");
|
||||||
|
#else
|
||||||
QFETCH(QHostAddress, target);
|
QFETCH(QHostAddress, target);
|
||||||
QUdpSocket socket;
|
QUdpSocket socket;
|
||||||
socket.connectToHost(target, 80);
|
socket.connectToHost(target, 80);
|
||||||
@ -253,6 +258,7 @@ void tst_QNetworkInterface::localAddress()
|
|||||||
|
|
||||||
// check that the Path MTU is less than or equal the interface's MTU
|
// check that the Path MTU is less than or equal the interface's MTU
|
||||||
QVERIFY(pmtu <= outgoingIface->maximumTransmissionUnit());
|
QVERIFY(pmtu <= outgoingIface->maximumTransmissionUnit());
|
||||||
|
#endif // QT_CONFIG(udpsocket)
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_QNetworkInterface::interfaceFromXXX_data()
|
void tst_QNetworkInterface::interfaceFromXXX_data()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user