tst_bench_QCryptographicHash: swallow result() return values

As usual, assign them to a [[maybe_unused]] variable, to avoid
potential future [[nodiscard]] problems, and to indicate to
readers of the code that there's a result that's being returned,
we're just not interested in it.

Pick-to: 6.5 6.2
Change-Id: I2bd47ca98418092ca885d50a1a6417a21a612a85
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
Marc Mutz 2023-03-22 08:57:34 +01:00
parent d0149e2404
commit 25c5452c26

View File

@ -82,7 +82,8 @@ void tst_QCryptographicHash::hash()
QFETCH(QByteArray, data);
QBENCHMARK {
QCryptographicHash::hash(data, algo);
[[maybe_unused]]
auto r = QCryptographicHash::hash(data, algo);
}
}
@ -95,7 +96,8 @@ void tst_QCryptographicHash::addData()
QBENCHMARK {
hash.reset();
hash.addData(data);
hash.result();
[[maybe_unused]]
auto r = hash.result();
}
}
@ -113,7 +115,8 @@ void tst_QCryptographicHash::addDataChunked()
hash.addData({data.constData() + 64 * i, 64});
hash.addData({data.constData() + data.size() / 64 * 64, data.size() % 64});
hash.result();
[[maybe_unused]]
auto r = hash.result();
}
}