tst_QCryptographicHash: avoid duplicate data tags

Use key(i) rather than valueToKey(value) as the Sha3_* alias Kekkak_*
or RealSha3_*. This way, we still test all members of the enum,
without duplicating row keys (albeit the aliases duplicate values).

Change-Id: I6acba5ffdf5b68294031d609a76b37ca8fad9d94
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
bb10
Edward Welbourne 2022-10-07 17:47:13 +02:00
parent 0448d57c07
commit c10132888e
1 changed files with 1 additions and 1 deletions

View File

@ -393,7 +393,7 @@ void tst_QCryptographicHash::hashLength_data()
auto metaEnum = QMetaEnum::fromType<QCryptographicHash::Algorithm>();
for (int i = 0, value = metaEnum.value(i); value != -1; value = metaEnum.value(++i)) {
auto algorithm = QCryptographicHash::Algorithm(value);
QTest::addRow("%s", metaEnum.valueToKey(value)) << algorithm;
QTest::addRow("%s", metaEnum.key(i)) << algorithm;
}
}