diff options
author | Marc Mutz <marc.mutz@qt.io> | 2023-03-20 10:57:16 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2023-03-20 14:42:11 +0100 |
commit | f4f49523ad530956089bc52173cdf4f99644a927 (patch) | |
tree | 09e23ee0748c9ab4780207c5cdaece060840b240 /tests/auto/corelib/tools | |
parent | a011e47f3d2980e9d550aa865acc211899828ad3 (diff) |
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>
Diffstat (limited to 'tests/auto/corelib/tools')
-rw-r--r-- | tests/auto/corelib/tools/qmessageauthenticationcode/tst_qmessageauthenticationcode.cpp | 6 |
1 files 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 85138a6402..c49cd538d2 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(); |