summaryrefslogtreecommitdiffstats
path: root/tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-04-07 13:16:42 +0200
committerMarc Mutz <marc.mutz@qt.io>2022-04-08 07:11:30 +0200
commit330efe20f7e97caf0162ae29b940508f95c0e3c5 (patch)
treea1ff464ca19f6516f80291c0f4729f9382cf186c /tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp
parentf90c82488a57079fe7568f4eaba23a631686f30f (diff)
Replace count() comparisons against 0 with isEmpty()
Pick-to: 6.3 Change-Id: I0a14c1737cda87fa30d207bdf5b2a697214b7e70 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp')
-rw-r--r--tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp b/tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp
index 3a58de2a..e1ef9591 100644
--- a/tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp
+++ b/tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp
@@ -127,7 +127,7 @@ void tst_QBluetoothServiceDiscoveryAgent::initTestCase()
// Wait for up to MaxScanTime for the scan to finish
int scanTime = MaxScanTime;
- while (finishedSpy.count() == 0 && scanTime > 0) {
+ while (finishedSpy.isEmpty() && scanTime > 0) {
QTest::qWait(1000);
scanTime -= 1000;
}
@@ -177,7 +177,7 @@ void tst_QBluetoothServiceDiscoveryAgent::tst_invalidBtAddress()
discoveryAgent = new QBluetoothServiceDiscoveryAgent(QBluetoothAddress());
QCOMPARE(discoveryAgent->error(), QBluetoothServiceDiscoveryAgent::NoError);
- if (QBluetoothLocalDevice::allDevices().count() > 0) {
+ if (!QBluetoothLocalDevice::allDevices().isEmpty()) {
discoveryAgent->start();
QCOMPARE(discoveryAgent->isActive(), true);
}
@@ -352,7 +352,7 @@ void tst_QBluetoothServiceDiscoveryAgent::tst_serviceDiscoveryAdapters()
discoveryAgent.start();
int scanTime = MaxScanTime;
- while (finishedSpy.count() == 0 && scanTime > 0) {
+ while (finishedSpy.isEmpty() && scanTime > 0) {
QTest::qWait(1000);
scanTime -= 1000;
}
@@ -416,7 +416,7 @@ void tst_QBluetoothServiceDiscoveryAgent::tst_serviceDiscovery()
// Wait for up to MaxScanTime for the scan to finish
int scanTime = 20000;
- while (finishedSpy.count() == 0 && scanTime > 0) {
+ while (finishedSpy.isEmpty() && scanTime > 0) {
QTest::qWait(1000);
scanTime -= 1000;
}
@@ -435,7 +435,7 @@ void tst_QBluetoothServiceDiscoveryAgent::tst_serviceDiscovery()
QVERIFY(errorSpy.isEmpty());
- //if (discoveryAgent.discoveredServices().count() && expected_failures++ <2){
+ //if (!discoveryAgent.discoveredServices().isEmpty() && expected_failures++ <2){
if (discoveredSpy.isEmpty()) {
qDebug() << "Device failed to return any results, skipping device" << discoveryAgent.discoveredServices().count();
return;
@@ -472,9 +472,9 @@ void tst_QBluetoothServiceDiscoveryAgent::tst_serviceDiscovery()
}
if (servicesFound)
- QVERIFY(discoveryAgent.discoveredServices().count() != 0);
+ QVERIFY(!discoveryAgent.discoveredServices().isEmpty());
discoveryAgent.clear();
- QVERIFY(discoveryAgent.discoveredServices().count() == 0);
+ QVERIFY(discoveryAgent.discoveredServices().isEmpty());
discoveryAgent.stop();
QVERIFY(!discoveryAgent.isActive());