summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2023-03-22 08:50:42 +0100
committerMarc Mutz <marc.mutz@qt.io>2023-03-24 09:51:10 +0100
commit89577efda74cb818fa787d10785843b3d3bc2c1f (patch)
tree5dfed07bc7e941c1ea0f1e557f0a3a24a4847fed
parent57f44282b040a3ce0b44bb0fc63bfca0d96b9cb5 (diff)
tst_bench_QCryptographicHash: port to QTest::addRow()
Allows using printf-style tag formatting. Change-Id: Icb8014dd476a32791c662a15b209dbb3bd7d6c96 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit f68b9e432ba979c0cd70cd3e738ce06ff224b9d2)
-rw-r--r--tests/benchmarks/corelib/tools/qcryptographichash/main.cpp48
1 files changed, 24 insertions, 24 deletions
diff --git a/tests/benchmarks/corelib/tools/qcryptographichash/main.cpp b/tests/benchmarks/corelib/tools/qcryptographichash/main.cpp
index 1f0a7373bb..0ed878a2c9 100644
--- a/tests/benchmarks/corelib/tools/qcryptographichash/main.cpp
+++ b/tests/benchmarks/corelib/tools/qcryptographichash/main.cpp
@@ -59,51 +59,51 @@ const char *algoname(int i)
{
switch (QCryptographicHash::Algorithm(i)) {
case QCryptographicHash::Md4:
- return "md4-";
+ return "md4";
case QCryptographicHash::Md5:
- return "md5-";
+ return "md5";
case QCryptographicHash::Sha1:
- return "sha1-";
+ return "sha1";
case QCryptographicHash::Sha224:
- return "sha2_224-";
+ return "sha2_224";
case QCryptographicHash::Sha256:
- return "sha2_256-";
+ return "sha2_256";
case QCryptographicHash::Sha384:
- return "sha2_384-";
+ return "sha2_384";
case QCryptographicHash::Sha512:
- return "sha2_512-";
+ return "sha2_512";
case QCryptographicHash::Sha3_224:
- return "sha3_224-";
+ return "sha3_224";
case QCryptographicHash::Sha3_256:
- return "sha3_256-";
+ return "sha3_256";
case QCryptographicHash::Sha3_384:
- return "sha3_384-";
+ return "sha3_384";
case QCryptographicHash::Sha3_512:
- return "sha3_512-";
+ return "sha3_512";
case QCryptographicHash::Keccak_224:
- return "keccak_224-";
+ return "keccak_224";
case QCryptographicHash::Keccak_256:
- return "keccak_256-";
+ return "keccak_256";
case QCryptographicHash::Keccak_384:
- return "keccak_384-";
+ return "keccak_384";
case QCryptographicHash::Keccak_512:
- return "keccak_512-";
+ return "keccak_512";
case QCryptographicHash::Blake2b_160:
- return "blake2b_160-";
+ return "blake2b_160";
case QCryptographicHash::Blake2b_256:
- return "blake2b_256-";
+ return "blake2b_256";
case QCryptographicHash::Blake2b_384:
- return "blake2b_384-";
+ return "blake2b_384";
case QCryptographicHash::Blake2b_512:
- return "blake2b_512-";
+ return "blake2b_512";
case QCryptographicHash::Blake2s_128:
- return "blake2s_128-";
+ return "blake2s_128";
case QCryptographicHash::Blake2s_160:
- return "blake2s_160-";
+ return "blake2s_160";
case QCryptographicHash::Blake2s_224:
- return "blake2s_224-";
+ return "blake2s_224";
case QCryptographicHash::Blake2s_256:
- return "blake2s_256-";
+ return "blake2s_256";
}
Q_UNREACHABLE();
return nullptr;
@@ -135,7 +135,7 @@ void tst_bench_QCryptographicHash::hash_data()
QByteArray data = QByteArray::fromRawData(blockOfData.constData(), datasizes[i]);
for (int algo = QCryptographicHash::Md4; algo <= MaxCryptoAlgorithm; ++algo)
- QTest::newRow(algoname(algo) + QByteArray::number(datasizes[i])) << algo << data;
+ QTest::addRow("%s-%d", algoname(algo), datasizes[i]) << algo << data;
}
}