summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/corelib/tools')
-rw-r--r--tests/auto/corelib/tools/qcryptographichash/tst_qcryptographichash.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/auto/corelib/tools/qcryptographichash/tst_qcryptographichash.cpp b/tests/auto/corelib/tools/qcryptographichash/tst_qcryptographichash.cpp
index 92a2c3516c..a943280996 100644
--- a/tests/auto/corelib/tools/qcryptographichash/tst_qcryptographichash.cpp
+++ b/tests/auto/corelib/tools/qcryptographichash/tst_qcryptographichash.cpp
@@ -425,7 +425,7 @@ void tst_QCryptographicHash::hashLength()
{
QFETCH(const QCryptographicHash::Algorithm, algorithm);
- QByteArray output = QCryptographicHash::hash(QByteArrayLiteral("test"), algorithm);
+ QByteArray output = QCryptographicHash::hash("test", algorithm);
QCOMPARE(QCryptographicHash::hashLength(algorithm), output.length());
}
@@ -480,22 +480,22 @@ void tst_QCryptographicHash::moreThan4GiBOfData()
qDebug() << algorithm << "test finished in" << timer.restart() << "ms";
});
- const auto begin = large.data();
- const auto mid = begin + large.size() / 2;
- const auto end = begin + large.size();
+ const auto view = QByteArrayView{large};
+ const auto first = view.first(view.size() / 2);
+ const auto last = view.sliced(view.size() / 2);
QByteArray single;
QByteArray chunked;
auto t = MaybeThread{[&] {
QCryptographicHash h(algorithm);
- h.addData(begin, end - begin);
+ h.addData(view);
single = h.result();
}};
{
QCryptographicHash h(algorithm);
- h.addData(begin, mid - begin);
- h.addData(mid, end - mid);
+ h.addData(first);
+ h.addData(last);
chunked = h.result();
}
t.join();