diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-07-17 12:57:28 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-07-22 17:02:34 +0200 |
commit | b2f51059cc034f03c70df28a5597a591ed3e5c5d (patch) | |
tree | fa607f601f623f70a05aabc18801c6daed4c2a18 /test/buildtool/crypto/hasher.test.cpp | |
parent | 0b80611163ffedb87dc2305320906f27e502cbcd (diff) | |
download | justbuild-b2f51059cc034f03c70df28a5597a591ed3e5c5d.tar.gz |
Create Hasher using a static function
Diffstat (limited to 'test/buildtool/crypto/hasher.test.cpp')
-rw-r--r-- | test/buildtool/crypto/hasher.test.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/test/buildtool/crypto/hasher.test.cpp b/test/buildtool/crypto/hasher.test.cpp index 0ee0cca1..4f5e8448 100644 --- a/test/buildtool/crypto/hasher.test.cpp +++ b/test/buildtool/crypto/hasher.test.cpp @@ -20,10 +20,11 @@ template <Hasher::HashType type> void test_increment_hash(std::string const& bytes, std::string const& result) { - Hasher hasher{type}; - hasher.Update(bytes.substr(0, bytes.size() / 2)); - hasher.Update(bytes.substr(bytes.size() / 2)); - auto digest = std::move(hasher).Finalize(); + auto hasher = Hasher::Create(type); + REQUIRE(hasher.has_value()); + hasher->Update(bytes.substr(0, bytes.size() / 2)); + hasher->Update(bytes.substr(bytes.size() / 2)); + auto digest = std::move(*hasher).Finalize(); CHECK(digest.HexString() == result); } |