summaryrefslogtreecommitdiffstats
path: root/tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-04-07 14:12:32 +0200
committerMarc Mutz <marc.mutz@qt.io>2022-04-11 15:21:46 +0200
commit4d975c3ffc47e4d67609bf3dd9eb487ba7fdf376 (patch)
tree390bb5fdfe76657ce19feb5d85d5cb9e7bedef27 /tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp
parent831e364b580eb8412573ddce55acd7481754779a (diff)
Port simple cases of count() to size()
The count() methods on QByteArray and QString are deprecated. The ones on other Qt containers will likely follow soon, so port them all to size(). The changes which also require int -> qsizetype will come in a follow-up patch. Pick-to: 6.3 Change-Id: I23e364019b9cfc457d93f4a3bb4660fe8d790da8 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Juha Vuolle <juha.vuolle@insta.fi> 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.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp b/tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp
index e1ef9591..83c79503 100644
--- a/tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp
+++ b/tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp
@@ -133,7 +133,7 @@ void tst_QBluetoothServiceDiscoveryAgent::initTestCase()
}
// Expect finished signal with no error
- QVERIFY(finishedSpy.count() == 1);
+ QVERIFY(finishedSpy.size() == 1);
QVERIFY(errorSpy.isEmpty());
devices = discoveryAgent.discoveredDevices();
@@ -153,12 +153,12 @@ void tst_QBluetoothServiceDiscoveryAgent::tst_serviceDiscoveryStop()
discoveryAgent.start(QBluetoothServiceDiscoveryAgent::FullDiscovery);
QVERIFY(discoveryAgent.isActive());
discoveryAgent.stop();
- QTRY_COMPARE(canceledSpy.count(), 1);
+ QTRY_COMPARE(canceledSpy.size(), 1);
QVERIFY(!discoveryAgent.isActive());
// Wait a bit to see that there are no latent signals
QTest::qWait(200);
- QCOMPARE(canceledSpy.count(), 1);
- QCOMPARE(finishedSpy.count(), 0);
+ QCOMPARE(canceledSpy.size(), 1);
+ QCOMPARE(finishedSpy.size(), 0);
}
@@ -431,13 +431,13 @@ void tst_QBluetoothServiceDiscoveryAgent::tst_serviceDiscovery()
// Expect finished signal with no error
if (scanTime)
- QVERIFY(finishedSpy.count() == 1);
+ QVERIFY(finishedSpy.size() == 1);
QVERIFY(errorSpy.isEmpty());
//if (!discoveryAgent.discoveredServices().isEmpty() && expected_failures++ <2){
if (discoveredSpy.isEmpty()) {
- qDebug() << "Device failed to return any results, skipping device" << discoveryAgent.discoveredServices().count();
+ qDebug() << "Device failed to return any results, skipping device" << discoveryAgent.discoveredServices().size();
return;
}