diff UnitTests/main.cpp @ 22:1bc6327d1de3

MD5 sum
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 27 Aug 2012 11:45:53 +0200
parents 3959d33612cc
children 166664f0f860
line wrap: on
line diff
--- a/UnitTests/main.cpp	Tue Jul 31 17:56:27 2012 +0200
+++ b/UnitTests/main.cpp	Mon Aug 27 11:45:53 2012 +0200
@@ -254,6 +254,18 @@
   ASSERT_EQ("image/png", Toolbox::AutodetectMimeType("NOTES.png"));
 }
 
+TEST(Toolbox, ComputeMD5)
+{
+  std::string s;
+
+  // # echo -n "Hello" | md5sum
+
+  Toolbox::ComputeMD5(s, "Hello");
+  ASSERT_EQ("8b1a9953c4611296a827abf8c47804d7", s);
+  Toolbox::ComputeMD5(s, "");
+  ASSERT_EQ("d41d8cd98f00b204e9800998ecf8427e", s);
+}
+
 
 int main(int argc, char **argv)
 {