From 0c1f9ab36b2611066cb5d08472d9a812ac7e4014 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 5 Apr 2022 10:43:37 +0200 Subject: [PATCH] benchmarks: fix deprecation warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - count() -> size() - QCryptographicHash::addData(ptr, ch) -> ({ptr, ch}) (QByteArrayView overload) Pick-to: 6.3 Change-Id: I15dddfa5c4385dd2a0fa0c3ae06c303c7151e2dc Reviewed-by: MÃ¥rten Nordheim --- .../qcryptographichash/tst_bench_qcryptographichash.cpp | 4 ++-- tests/benchmarks/gui/text/qtext/main.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/benchmarks/corelib/tools/qcryptographichash/tst_bench_qcryptographichash.cpp b/tests/benchmarks/corelib/tools/qcryptographichash/tst_bench_qcryptographichash.cpp index bff3ddbc260..42c214b1e96 100644 --- a/tests/benchmarks/corelib/tools/qcryptographichash/tst_bench_qcryptographichash.cpp +++ b/tests/benchmarks/corelib/tools/qcryptographichash/tst_bench_qcryptographichash.cpp @@ -176,8 +176,8 @@ void tst_QCryptographicHash::addDataChunked() // add the data in chunks of 64 bytes for (int i = 0; i < data.size() / 64; ++i) - hash.addData(data.constData() + 64 * i, 64); - hash.addData(data.constData() + data.size() / 64 * 64, data.size() % 64); + hash.addData({data.constData() + 64 * i, 64}); + hash.addData({data.constData() + data.size() / 64 * 64, data.size() % 64}); hash.result(); } diff --git a/tests/benchmarks/gui/text/qtext/main.cpp b/tests/benchmarks/gui/text/qtext/main.cpp index ef88f64d8f2..d98c2712e50 100644 --- a/tests/benchmarks/gui/text/qtext/main.cpp +++ b/tests/benchmarks/gui/text/qtext/main.cpp @@ -122,10 +122,10 @@ void tst_QText::shaping_data() QFile file(testFile); QVERIFY(file.open(QFile::ReadOnly)); QByteArray data = file.readAll(); - QVERIFY(data.count() > 1000); + QVERIFY(data.size() > 1000); QStringList list = QString::fromUtf8(data.data()).split(QLatin1Char('\n'), Qt::SkipEmptyParts); - QVERIFY(list.count() %2 == 0); // even amount as we have title and then content. - for (int i=0; i < list.count(); i+=2) { + QVERIFY(list.size() % 2 == 0); // even amount as we have title and then content. + for (int i = 0; i < list.size(); i += 2) { QTest::newRow(list.at(i).toLatin1()) << list.at(i+1); } }