comparison 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
comparison
equal deleted inserted replaced
21:29bfa3095207 22:1bc6327d1de3
252 ASSERT_EQ("image/jpeg", Toolbox::AutodetectMimeType("NOTES.jpg")); 252 ASSERT_EQ("image/jpeg", Toolbox::AutodetectMimeType("NOTES.jpg"));
253 ASSERT_EQ("image/jpeg", Toolbox::AutodetectMimeType("NOTES.jpeg")); 253 ASSERT_EQ("image/jpeg", Toolbox::AutodetectMimeType("NOTES.jpeg"));
254 ASSERT_EQ("image/png", Toolbox::AutodetectMimeType("NOTES.png")); 254 ASSERT_EQ("image/png", Toolbox::AutodetectMimeType("NOTES.png"));
255 } 255 }
256 256
257 TEST(Toolbox, ComputeMD5)
258 {
259 std::string s;
260
261 // # echo -n "Hello" | md5sum
262
263 Toolbox::ComputeMD5(s, "Hello");
264 ASSERT_EQ("8b1a9953c4611296a827abf8c47804d7", s);
265 Toolbox::ComputeMD5(s, "");
266 ASSERT_EQ("d41d8cd98f00b204e9800998ecf8427e", s);
267 }
268
257 269
258 int main(int argc, char **argv) 270 int main(int argc, char **argv)
259 { 271 {
260 PalantirInitialize(); 272 PalantirInitialize();
261 ::testing::InitGoogleTest(&argc, argv); 273 ::testing::InitGoogleTest(&argc, argv);