summaryrefslogtreecommitdiff
path: root/tests/test_sha256.cc
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2021-01-28 21:42:35 +0100
committerSanto Cariotti <santo@dcariotti.me>2021-01-28 21:42:35 +0100
commitf4fd89c776c9dccecc661058d272c7b252f6e85c (patch)
treea1a7ea7f041bc3a1d033b6d257b2c534a31d694f /tests/test_sha256.cc
parent938bd7bbf0f617d44ed9659addca3a4879948551 (diff)
conf: add cmake for tests
Diffstat (limited to 'tests/test_sha256.cc')
-rw-r--r--tests/test_sha256.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_sha256.cc b/tests/test_sha256.cc
new file mode 100644
index 0000000..a9ab7ad
--- /dev/null
+++ b/tests/test_sha256.cc
@@ -0,0 +1,10 @@
+#define CATCH_CONFIG_MAIN
+#include "catch.hpp"
+#include "sha256.h"
+
+TEST_CASE("SHA256 digest", "[format]") {
+ auto sha = hmacsha256::SHA256("hello, world");
+ sha.digest();
+
+ REQUIRE(sha.hexdigest() == "09ca7e4eaa6e8ae9c7d261167129184883644d07dfba7cbfbc4c8a2e08360d5b");
+}