From b2f51059cc034f03c70df28a5597a591ed3e5c5d Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Wed, 17 Jul 2024 12:57:28 +0200 Subject: Create Hasher using a static function --- test/buildtool/crypto/hasher.test.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'test/buildtool/crypto/hasher.test.cpp') 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 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); } -- cgit v1.2.3