diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-11-11 16:26:04 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-11-12 08:42:25 +0100 |
commit | 2f2e25c3beea21c14bb75b2f32b5ee4700759a89 (patch) | |
tree | eff1132b9135642b076cec6796691f91bbd07188 /tests/auto/qlowenergycontroller/tst_qlowenergycontroller.cpp | |
parent | cad49b3be482b41f1ae43b5c9ce4d009a810240b (diff) |
Port from qAsConst() to std::as_const()
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally
starts to bother us (QTBUG-99313), so time to port away from it
now.
Since qAsConst has exactly the same semantics as std::as_const (down
to rvalue treatment, constexpr'ness and noexcept'ness), there's really
nothing more to it than a global search-and-replace.
This is a 6.4 re-run of the script we ran in dev, in order to avoid
conflicts between the branches when cherry-picking.
Change-Id: I5eca3df3179dfb2b2682c75a479ba9a4259cc703
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Diffstat (limited to 'tests/auto/qlowenergycontroller/tst_qlowenergycontroller.cpp')
-rw-r--r-- | tests/auto/qlowenergycontroller/tst_qlowenergycontroller.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/auto/qlowenergycontroller/tst_qlowenergycontroller.cpp b/tests/auto/qlowenergycontroller/tst_qlowenergycontroller.cpp index 5a930dc3..67a9659f 100644 --- a/tests/auto/qlowenergycontroller/tst_qlowenergycontroller.cpp +++ b/tests/auto/qlowenergycontroller/tst_qlowenergycontroller.cpp @@ -323,7 +323,7 @@ void tst_QLowEnergyController::tst_connect() listing.append(v.value<QBluetoothUuid>()); } - for (const QBluetoothUuid &uuid : qAsConst(foundServices)) { + for (const QBluetoothUuid &uuid : std::as_const(foundServices)) { QVERIFY2(listing.contains(uuid), uuid.toString().toLatin1()); @@ -342,7 +342,7 @@ void tst_QLowEnergyController::tst_connect() QBluetoothUuid(QBluetoothUuid::CharacteristicType::DeviceName))); // initiate characteristic discovery - for (QLowEnergyService *service : qAsConst(savedReferences)) { + for (QLowEnergyService *service : std::as_const(savedReferences)) { qDebug() << "Discovering" << service->serviceUuid(); QSignalSpy stateSpy(service, SIGNAL(stateChanged(QLowEnergyService::ServiceState))); @@ -359,7 +359,7 @@ void tst_QLowEnergyController::tst_connect() } // ensure that related service objects share same state - for (QLowEnergyService* originalService : qAsConst(savedReferences)) { + for (QLowEnergyService* originalService : std::as_const(savedReferences)) { QLowEnergyService *newService = control->createServiceObject( originalService->serviceUuid()); QVERIFY(newService); @@ -379,7 +379,7 @@ void tst_QLowEnergyController::tst_connect() } else { QCOMPARE(disconnectedSpy.size(), 1); // after disconnect all service references must be invalid - for (const QLowEnergyService *entry : qAsConst(savedReferences)) { + for (const QLowEnergyService *entry : std::as_const(savedReferences)) { const QBluetoothUuid &uuid = entry->serviceUuid(); QVERIFY2(entry->state() == QLowEnergyService::InvalidService, uuid.toString().toLatin1()); |