diff options
author | Remko Tronçon <git@el-tramo.be> | 2013-04-26 20:07:58 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2013-04-27 11:02:06 (GMT) |
commit | 5d8c328e236f57d7390d32f9ea7bd17a31e1e740 (patch) | |
tree | bebe606707a6b835fe3fd15e694d629b5e420947 /Swiften/StringCodecs/UnitTest/MD5Test.cpp | |
parent | aa131405927fc7f597ed06aff71abb0a30b59926 (diff) | |
download | swift-contrib-5d8c328e236f57d7390d32f9ea7bd17a31e1e740.zip swift-contrib-5d8c328e236f57d7390d32f9ea7bd17a31e1e740.tar.bz2 |
Removing third-party hash implementations.
Using library/platform implementation instead.
Change-Id: I2457c2dad80e6fdda023a7f31c3906ff10fe09ed
Diffstat (limited to 'Swiften/StringCodecs/UnitTest/MD5Test.cpp')
-rw-r--r-- | Swiften/StringCodecs/UnitTest/MD5Test.cpp | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/Swiften/StringCodecs/UnitTest/MD5Test.cpp b/Swiften/StringCodecs/UnitTest/MD5Test.cpp deleted file mode 100644 index c62c46a..0000000 --- a/Swiften/StringCodecs/UnitTest/MD5Test.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2010 Remko Tronçon - * Licensed under the GNU General Public License v3. - * See Documentation/Licenses/GPLv3.txt for more information. - */ - -#include <Swiften/Base/ByteArray.h> -#include <QA/Checker/IO.h> - -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/extensions/TestFactoryRegistry.h> - -#include <Swiften/StringCodecs/MD5.h> -#include <Swiften/Base/ByteArray.h> - -using namespace Swift; - -class MD5Test : public CppUnit::TestFixture { - CPPUNIT_TEST_SUITE(MD5Test); - CPPUNIT_TEST(testGetHash_Empty); - CPPUNIT_TEST(testGetHash_Alphabet); - CPPUNIT_TEST(testIncrementalTest); - CPPUNIT_TEST_SUITE_END(); - - public: - void testGetHash_Empty() { - ByteArray result(MD5::getHash(createByteArray(""))); - - CPPUNIT_ASSERT_EQUAL(createByteArray("\xd4\x1d\x8c\xd9\x8f\x00\xb2\x04\xe9\x80\x09\x98\xec\xf8\x42\x7e", 16), result); - } - - void testGetHash_Alphabet() { - ByteArray result(MD5::getHash(createByteArray("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"))); - - CPPUNIT_ASSERT_EQUAL(createByteArray("\xd1\x74\xab\x98\xd2\x77\xd9\xf5\xa5\x61\x1c\x2c\x9f\x41\x9d\x9f", 16), result); - } - - void testIncrementalTest() { - MD5 testling; - testling.update(createByteArray("ABCDEFGHIJKLMNOPQRSTUVWXYZ")); - testling.update(createByteArray("abcdefghijklmnopqrstuvwxyz0123456789")); - - ByteArray result = testling.getHash(); - - CPPUNIT_ASSERT_EQUAL(createByteArray("\xd1\x74\xab\x98\xd2\x77\xd9\xf5\xa5\x61\x1c\x2c\x9f\x41\x9d\x9f", 16), result); - } -}; - -CPPUNIT_TEST_SUITE_REGISTRATION(MD5Test); |