void testHash () { char out[33]; md5->init (); md5->update (msg, strlen (msg)); char *ret = md5->end (out); CPPUNIT_ASSERT_EQUAL (ret, &out[0]); CPPUNIT_ASSERT_EQUAL (memcmp (expected, out, 32), 0); }
void testHashMemBuf () { MemBuf buffer; char out[33]; buffer << msg; md5->init (); md5->update (buffer); char *ret = md5->end (out); CPPUNIT_ASSERT_EQUAL (ret, &out[0]); CPPUNIT_ASSERT_EQUAL (memcmp (expected, out, 32), 0); }