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:
parent
a011e47f3d
commit
f4f49523ad
@ -147,8 +147,7 @@ void tst_QMessageAuthenticationCode::result()
|
|||||||
QFETCH(QByteArray, message);
|
QFETCH(QByteArray, message);
|
||||||
QFETCH(QByteArray, code);
|
QFETCH(QByteArray, code);
|
||||||
|
|
||||||
QMessageAuthenticationCode mac(algo);
|
QMessageAuthenticationCode mac(algo, key);
|
||||||
mac.setKey(key);
|
|
||||||
mac.addData(message);
|
mac.addData(message);
|
||||||
QByteArrayView resultView = mac.resultView();
|
QByteArrayView resultView = mac.resultView();
|
||||||
|
|
||||||
@ -176,8 +175,7 @@ void tst_QMessageAuthenticationCode::result_incremental()
|
|||||||
|
|
||||||
QCOMPARE(leftPart + rightPart, message);
|
QCOMPARE(leftPart + rightPart, message);
|
||||||
|
|
||||||
QMessageAuthenticationCode mac(algo);
|
QMessageAuthenticationCode mac(algo, key);
|
||||||
mac.setKey(key);
|
|
||||||
mac.addData(leftPart);
|
mac.addData(leftPart);
|
||||||
mac.addData(rightPart);
|
mac.addData(rightPart);
|
||||||
QByteArrayView result = mac.resultView();
|
QByteArrayView result = mac.resultView();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user