diff options
author | Remko Tronçon <git@el-tramo.be> | 2009-09-30 20:26:00 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2009-09-30 20:26:00 (GMT) |
commit | be0d01be9d6e98c59c6484e3bd691c4354142c4c (patch) | |
tree | 7e8d1d1a06db1cf7f79b56da04f622f8505f9a78 /Swiften/StringCodecs/UnitTest/SHA1Test.cpp | |
parent | 6c8f9f9619f464d21c81f850f7a73498568af5c4 (diff) | |
download | swift-contrib-be0d01be9d6e98c59c6484e3bd691c4354142c4c.zip swift-contrib-be0d01be9d6e98c59c6484e3bd691c4354142c4c.tar.bz2 |
Added SHA-1 and Base64 tests for empty input data.
Diffstat (limited to 'Swiften/StringCodecs/UnitTest/SHA1Test.cpp')
-rw-r--r-- | Swiften/StringCodecs/UnitTest/SHA1Test.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Swiften/StringCodecs/UnitTest/SHA1Test.cpp b/Swiften/StringCodecs/UnitTest/SHA1Test.cpp index e556429..849dd6d 100644 --- a/Swiften/StringCodecs/UnitTest/SHA1Test.cpp +++ b/Swiften/StringCodecs/UnitTest/SHA1Test.cpp @@ -11,6 +11,7 @@ class SHA1Test : public CppUnit::TestFixture CPPUNIT_TEST(testGetBinaryHash); CPPUNIT_TEST(testGetBinaryHash_Twice); CPPUNIT_TEST(testGetHexHash); + CPPUNIT_TEST(testGetHexHash_NoData); CPPUNIT_TEST_SUITE_END(); public: @@ -34,6 +35,12 @@ class SHA1Test : public CppUnit::TestFixture String result(SHA1::getHexHash("client/pc//Exodus 0.9.1<http://jabber.org/protocol/caps<http://jabber.org/protocol/disco#info<http://jabber.org/protocol/disco#items<http://jabber.org/protocol/muc<")); CPPUNIT_ASSERT_EQUAL(String("4206b23ca6b0a643d20d89b04ff58cf78b8096ed"), result); } + + void testGetHexHash_NoData() { + String result(SHA1::getHexHash(ByteArray())); + + CPPUNIT_ASSERT_EQUAL(String("da39a3ee5e6b4b0d3255bfef95601890afd80709"), result); + } }; CPPUNIT_TEST_SUITE_REGISTRATION(SHA1Test); |