aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/test_hash.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/tests/test_hash.cpp b/src/tests/test_hash.cpp
index eaa3ff3b5..cd0fb785b 100644
--- a/src/tests/test_hash.cpp
+++ b/src/tests/test_hash.cpp
@@ -41,6 +41,20 @@ size_t hash_test(const std::string& algo,
std::cout << algo << " " << provider << " got " << hex_encode(h) << " != " << out_hex << "\n";
++fails;
}
+
+ // Test to make sure clear() resets what we need it to
+ hash->update("some discarded input");
+ hash->clear();
+
+ hash->update(hex_decode(in_hex));
+
+ h = hash->final();
+
+ if(h != hex_decode_locked(out_hex))
+ {
+ std::cout << algo << " " << provider << " got " << hex_encode(h) << " != " << out_hex << "\n";
+ ++fails;
+ }
}
return fails;