Add some md5 tests

pull/128/merge
Nils Maier 2013-09-20 23:07:11 +02:00
parent 7cb69c4d9e
commit 08e2e412dc
1 changed files with 8 additions and 0 deletions

View File

@ -42,10 +42,18 @@ void MessageDigestTest::testDigest()
md5_->update("aria2", 5);
CPPUNIT_ASSERT_EQUAL(std::string("2c90cadbef42945f0dcff2b959977ff8"),
util::toHex(md5_->digest()));
md5_->reset();
md5_->update("abc", 3);
CPPUNIT_ASSERT_EQUAL(std::string("900150983cd24fb0d6963f7d28e17f72"),
util::toHex(md5_->digest()));
sha1_->update("aria2", 5);
CPPUNIT_ASSERT_EQUAL(std::string("f36003f22b462ffa184390533c500d8989e9f681"),
util::toHex(sha1_->digest()));
sha1_->reset();
sha1_->update("abc", 3);
CPPUNIT_ASSERT_EQUAL(std::string("a9993e364706816aba3e25717850c26c9cd0d89d"),
util::toHex(sha1_->digest()));
}
void MessageDigestTest::testSupports()