tst_QMessageAuthenticationCode: avoid setKey() calls

We test setKey() in repeated_setKey() these days, so speed up the test
of the test suite ever so slightly by passing the key to the ctor
instead of an explicit setKey() call.

Pick-to: 6.5
Change-Id: Ia2378c0f59cbfa9d95a0f3665b06655332247e2c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
Marc Mutz 2023-03-20 10:57:16 +01:00
parent a011e47f3d
commit f4f49523ad

View File

@ -147,8 +147,7 @@ void tst_QMessageAuthenticationCode::result()
QFETCH(QByteArray, message);
QFETCH(QByteArray, code);
QMessageAuthenticationCode mac(algo);
mac.setKey(key);
QMessageAuthenticationCode mac(algo, key);
mac.addData(message);
QByteArrayView resultView = mac.resultView();
@ -176,8 +175,7 @@ void tst_QMessageAuthenticationCode::result_incremental()
QCOMPARE(leftPart + rightPart, message);
QMessageAuthenticationCode mac(algo);
mac.setKey(key);
QMessageAuthenticationCode mac(algo, key);
mac.addData(leftPart);
mac.addData(rightPart);
QByteArrayView result = mac.resultView();