From f4f49523ad530956089bc52173cdf4f99644a927 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Mon, 20 Mar 2023 10:57:16 +0100 Subject: [PATCH] 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 --- .../tst_qmessageauthenticationcode.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/auto/corelib/tools/qmessageauthenticationcode/tst_qmessageauthenticationcode.cpp b/tests/auto/corelib/tools/qmessageauthenticationcode/tst_qmessageauthenticationcode.cpp index 85138a6402a..c49cd538d2a 100644 --- a/tests/auto/corelib/tools/qmessageauthenticationcode/tst_qmessageauthenticationcode.cpp +++ b/tests/auto/corelib/tools/qmessageauthenticationcode/tst_qmessageauthenticationcode.cpp @@ -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();