summaryrefslogtreecommitdiffstats
path: root/tests/auto/qbluetoothsocket/tst_qbluetoothsocket.cpp
diff options
context:
space:
mode:
authorTarja Sundqvist <tarja.sundqvist@qt.io>2023-03-23 21:57:01 +0200
committerTarja Sundqvist <tarja.sundqvist@qt.io>2023-03-23 21:57:01 +0200
commit3dcb548bd6fe4aa488ca0bac95e65a7a366c3eca (patch)
treed8e263e0341880d970832326c7c7cecfd05e67cd /tests/auto/qbluetoothsocket/tst_qbluetoothsocket.cpp
parente957d4810b05d8453e163d7bcdcab42d3c60a7bb (diff)
parent2b3b5c899ebdb0fc11273af7370804f5f03ad9e8 (diff)
Merge remote-tracking branch 'origin/tqtc/lts-5.15.9' into tqtc/lts-5.15-opensourcev5.15.9-lts-lgpl
Diffstat (limited to 'tests/auto/qbluetoothsocket/tst_qbluetoothsocket.cpp')
-rw-r--r--tests/auto/qbluetoothsocket/tst_qbluetoothsocket.cpp12
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