commit ee3c247722046c6e96e64523e5a0c4989f80802d
parent b0985c227a185df26996c3a0a7d091da33b56f3e
Author: cfillion <cfillion@users.noreply.github.com>
Date: Sat, 8 Dec 2018 13:38:00 -0500
ensure calling Hash::digest multiple times won't break in the future
Diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/test/hash.cpp b/test/hash.cpp
@@ -7,10 +7,12 @@ static const char *M = "[hash]";
TEST_CASE("sha256 hashes", M) {
Hash hash(Hash::SHA256);
- SECTION("empty") {
+ SECTION("empty")
REQUIRE(hash.digest() ==
"1220e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855");
- }
+
+ SECTION("digest twice")
+ REQUIRE(hash.digest() == hash.digest());
SECTION("single chunk") {
hash.addData("hello world", 11);