diff options
author | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2023-03-23 21:57:01 +0200 |
---|---|---|
committer | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2023-03-23 21:57:01 +0200 |
commit | 3dcb548bd6fe4aa488ca0bac95e65a7a366c3eca (patch) | |
tree | d8e263e0341880d970832326c7c7cecfd05e67cd /tests/auto/qbluetoothsocket/tst_qbluetoothsocket.cpp | |
parent | e957d4810b05d8453e163d7bcdcab42d3c60a7bb (diff) | |
parent | 2b3b5c899ebdb0fc11273af7370804f5f03ad9e8 (diff) |
Merge remote-tracking branch 'origin/tqtc/lts-5.15.9' into tqtc/lts-5.15-opensourcev5.15.9-lts-lgpl
Change-Id: I6f5b5789b64c033f10223c2147ce7a312d868230
Diffstat (limited to 'tests/auto/qbluetoothsocket/tst_qbluetoothsocket.cpp')
-rw-r--r-- | tests/auto/qbluetoothsocket/tst_qbluetoothsocket.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/auto/qbluetoothsocket/tst_qbluetoothsocket.cpp b/tests/auto/qbluetoothsocket/tst_qbluetoothsocket.cpp index 05bc1a0f..9e0dfc54 100644 --- a/tests/auto/qbluetoothsocket/tst_qbluetoothsocket.cpp +++ b/tests/auto/qbluetoothsocket/tst_qbluetoothsocket.cpp @@ -35,6 +35,9 @@ #include <qbluetoothserviceinfo.h> #include <qbluetoothservicediscoveryagent.h> #include <qbluetoothlocaldevice.h> +#if QT_CONFIG(bluez) +#include <QtBluetooth/private/bluez5_helper_p.h> +#endif QT_USE_NAMESPACE @@ -142,7 +145,7 @@ void tst_QBluetoothSocket::initTestCase() qDebug() << "Starting discovery"; sda->setUuidFilter(QBluetoothUuid(QString(TEST_SERVICE_UUID))); - sda->start(QBluetoothServiceDiscoveryAgent::MinimalDiscovery); + sda->start(QBluetoothServiceDiscoveryAgent::FullDiscovery); for (int connectTime = MaxConnectTime; !done_discovery && connectTime > 0; connectTime -= 1000) QTest::qWait(1000); @@ -506,7 +509,12 @@ void tst_QBluetoothSocket::tst_preferredSecurityFlags() #if defined(QT_ANDROID_BLUETOOTH) | defined(QT_OSX_BLUETOOTH) QCOMPARE(socket.preferredSecurityFlags(), QBluetooth::Secure); #elif QT_CONFIG(bluez) - QCOMPARE(socket.preferredSecurityFlags(), QBluetooth::Authorization); + // The bluezdbus socket uses "NoSecurity" by default, whereas the non-dbus bluez + // socket uses "Authorization" by default + if (bluetoothdVersion() >= QVersionNumber(5, 42)) + QCOMPARE(socket.preferredSecurityFlags(), QBluetooth::Security::NoSecurity); + else + QCOMPARE(socket.preferredSecurityFlags(), QBluetooth::Security::Authorization); #else QCOMPARE(socket.preferredSecurityFlags(), QBluetooth::NoSecurity); #endif |