0411d98192
Add Algorithm::NumAlgorithms and use it to iterate over all statically-available algorithms, querying their hashLengthInternal(). This avoids having to statically_assert(<= MaxHashLength) everywhere, and auto-adjusts the buffer size in SHA1_ONLY builds. Yes, the extra case labels for NumAlgorithms are a nuisance, but at least the compiler will remind us when we forget, unlike a missing static_cast(<= MaxHashLength) that might easily be forgotten. Adjust the test (which iterates over the QMetaEnum for QCryptographicHash::Algorithm, so finds NumAlgorithms and tries to pass it to the hash() function which responds with a Q_UNREACHABLE(). Only test hashLength() == 0 for that enum value. Pick-to: 6.5 Change-Id: I70155d2460464f0b2094e136eb6bea185effc9d5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> |
||
---|---|---|
.. | ||
data | ||
.gitignore | ||
CMakeLists.txt | ||
tst_qcryptographichash.cpp |