diff options
| author | Joel Klinghed <the_jk@spawned.biz> | 2021-11-17 22:34:57 +0100 |
|---|---|---|
| committer | Joel Klinghed <the_jk@spawned.biz> | 2021-11-17 22:34:57 +0100 |
| commit | 6232d13f5321b87ddf12a1aa36b4545da45f173d (patch) | |
| tree | 23f3316470a14136debd9d02f9e920ca2b06f4cc /test/test_hash_method.cc | |
Travel3: Simple image and video display site
Reads the images and videos from filesystem and builds a site in
memroy.
Diffstat (limited to 'test/test_hash_method.cc')
| -rw-r--r-- | test/test_hash_method.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/test_hash_method.cc b/test/test_hash_method.cc new file mode 100644 index 0000000..d0c9d20 --- /dev/null +++ b/test/test_hash_method.cc @@ -0,0 +1,19 @@ +#include "common.hh" + +#include "hash_method.hh" + +#include <gtest/gtest.h> + +TEST(hash_method, sha256) { + auto hash = HashMethod::sha256(); + EXPECT_EQ("e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + hash->finish()); + + hash->update("foobar", 6); + EXPECT_EQ("c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2", + hash->finish()); + + hash->update("foo", 3); + EXPECT_EQ("2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae", + hash->finish()); +} |
