summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools/qmessageauthenticationcode
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2023-02-23 21:13:25 +0100
committerMarc Mutz <marc.mutz@qt.io>2023-03-01 17:20:41 +0100
commit6990f23813bc14be791838949dd93b5b33b40b77 (patch)
tree4f2dc6d400be2f091f79f10208acbc834e02adeb /tests/auto/corelib/tools/qmessageauthenticationcode
parent7af39be05295c5743d04ef83468a0d250141b145 (diff)
Long live QMessageAuthenticationCode::resultView()!
Use it in a few places. [ChangeLog][QtCore][QMessageAuthenticationCode] Added QCryptographicHash-style resultView(). Change-Id: I745d71f86f9c19c9a9aabb2021c6617775dab1cf Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'tests/auto/corelib/tools/qmessageauthenticationcode')
-rw-r--r--tests/auto/corelib/tools/qmessageauthenticationcode/tst_qmessageauthenticationcode.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/auto/corelib/tools/qmessageauthenticationcode/tst_qmessageauthenticationcode.cpp b/tests/auto/corelib/tools/qmessageauthenticationcode/tst_qmessageauthenticationcode.cpp
index 59fecc1b56..002f6f587a 100644
--- a/tests/auto/corelib/tools/qmessageauthenticationcode/tst_qmessageauthenticationcode.cpp
+++ b/tests/auto/corelib/tools/qmessageauthenticationcode/tst_qmessageauthenticationcode.cpp
@@ -148,11 +148,11 @@ void tst_QMessageAuthenticationCode::result()
QMessageAuthenticationCode mac(algo);
mac.setKey(key);
mac.addData(message);
- QByteArray result = mac.result();
+ QByteArrayView resultView = mac.resultView();
- QCOMPARE(result, code);
+ QCOMPARE(resultView, code);
- result = QMessageAuthenticationCode::hash(message, key, algo);
+ const auto result = QMessageAuthenticationCode::hash(message, key, algo);
QCOMPARE(result, code);
}
@@ -178,7 +178,7 @@ void tst_QMessageAuthenticationCode::result_incremental()
mac.setKey(key);
mac.addData(leftPart);
mac.addData(rightPart);
- QByteArray result = mac.result();
+ QByteArrayView result = mac.resultView();
QCOMPARE(result, code);
}
@@ -200,7 +200,7 @@ void tst_QMessageAuthenticationCode::addData_overloads()
QMessageAuthenticationCode mac(algo);
mac.setKey(key);
mac.addData(message.constData(), message.size());
- QByteArray result = mac.result();
+ QByteArrayView result = mac.resultView();
QCOMPARE(result, code);
}
@@ -212,7 +212,7 @@ void tst_QMessageAuthenticationCode::addData_overloads()
QMessageAuthenticationCode mac(algo);
mac.setKey(key);
QVERIFY(mac.addData(&buffer));
- QByteArray result = mac.result();
+ QByteArrayView result = mac.resultView();
buffer.close();
QCOMPARE(result, code);