diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2021-07-07 07:31:49 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2021-07-07 17:36:07 +0200 |
commit | a5760a1741e55cdab9b868d4b8b14d978792626d (patch) | |
tree | cc32e639a92eb8edec543936c9f2375bc939f629 /tests/auto/corelib | |
parent | 43d8e81e56ab2bc4d30b1d8c6fa0a73b72492cd0 (diff) |
tst_QCryptographicHash: simplify the creation of a large QBA
Use the ctor instead of appending 1'000'000 chars.
Introduce C++14 digit separators as a drive-by.
Change-Id: Icdbef3173f42d12ae2226b8556f9b1519e594adc
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'tests/auto/corelib')
-rw-r--r-- | tests/auto/corelib/tools/qcryptographichash/tst_qcryptographichash.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/tests/auto/corelib/tools/qcryptographichash/tst_qcryptographichash.cpp b/tests/auto/corelib/tools/qcryptographichash/tst_qcryptographichash.cpp index a943280996..4560a3fe08 100644 --- a/tests/auto/corelib/tools/qcryptographichash/tst_qcryptographichash.cpp +++ b/tests/auto/corelib/tools/qcryptographichash/tst_qcryptographichash.cpp @@ -209,10 +209,7 @@ void tst_QCryptographicHash::sha1() // SHA1(A million repetitions of "a") = // 34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F - QByteArray as; - for (int i = 0; i < 1000000; ++i) - as += 'a'; - QCOMPARE(QCryptographicHash::hash(as, QCryptographicHash::Sha1).toHex().toUpper(), + QCOMPARE(QCryptographicHash::hash(QByteArray(1'000'000, 'a'), QCryptographicHash::Sha1).toHex().toUpper(), QByteArray("34AA973CD4C4DAA4F61EEB2BDBAD27316534016F")); } |