QCryptographicHash: add specific test for static hash() function
The test already exercised the function here and there, but it lacked a central place to test the static hash() method, so add one. Pick-to: 6.7 6.5 Change-Id: I229bc8a8ed07e0036f60de62ecc4d11ef88dd20e Reviewed-by: Ahmad Samir <a.samirh78@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
6736fe3a0f
commit
8586f9e1b9
@ -20,6 +20,8 @@ private slots:
|
||||
void repeated_result();
|
||||
void intermediary_result_data();
|
||||
void intermediary_result();
|
||||
void static_hash_data() { intermediary_result_data(); }
|
||||
void static_hash();
|
||||
void sha1();
|
||||
void sha3_data();
|
||||
void sha3();
|
||||
@ -197,6 +199,17 @@ void tst_QCryptographicHash::intermediary_result()
|
||||
hash.reset();
|
||||
}
|
||||
|
||||
void tst_QCryptographicHash::static_hash()
|
||||
{
|
||||
QFETCH(const int, algo);
|
||||
QFETCH(const QByteArray, first);
|
||||
QFETCH(const QByteArray, hash_first);
|
||||
|
||||
const auto _algo = QCryptographicHash::Algorithm(algo);
|
||||
|
||||
QCOMPARE(QCryptographicHash::hash(first, _algo), hash_first);
|
||||
}
|
||||
|
||||
|
||||
void tst_QCryptographicHash::sha1()
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user