diff options
author | Remko Tronçon <git@el-tramo.be> | 2009-11-19 20:54:01 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2009-11-19 20:54:20 (GMT) |
commit | 250ede4f32a14f566fbafd634e2024c93677cf19 (patch) | |
tree | 7e09ea5c685e046145d5f238409af235798a85f1 /Swiften/StringCodecs/UnitTest | |
parent | 1e4a5816db5178b535a4405dd54df4c95491810f (diff) | |
download | swift-250ede4f32a14f566fbafd634e2024c93677cf19.zip swift-250ede4f32a14f566fbafd634e2024c93677cf19.tar.bz2 |
Added missing files of previous commit.
Diffstat (limited to 'Swiften/StringCodecs/UnitTest')
-rw-r--r-- | Swiften/StringCodecs/UnitTest/HMACSHA1Test.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Swiften/StringCodecs/UnitTest/HMACSHA1Test.cpp b/Swiften/StringCodecs/UnitTest/HMACSHA1Test.cpp new file mode 100644 index 0000000..edfae10 --- /dev/null +++ b/Swiften/StringCodecs/UnitTest/HMACSHA1Test.cpp @@ -0,0 +1,21 @@ +#include <cppunit/extensions/HelperMacros.h> +#include <cppunit/extensions/TestFactoryRegistry.h> + +#include "Swiften/Base/ByteArray.h" +#include "Swiften/StringCodecs/HMACSHA1.h" + +using namespace Swift; + +class HMACSHA1Test : public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(HMACSHA1Test); + CPPUNIT_TEST(testGetResult); + CPPUNIT_TEST_SUITE_END(); + + public: + void testGetResult() { + ByteArray result(HMACSHA1::getResult("foo", "foobar")); + CPPUNIT_ASSERT_EQUAL(ByteArray("\xa4\xee\xba\x8e\x63\x3d\x77\x88\x69\xf5\x68\xd0\x5a\x1b\x3d\xc7\x2b\xfd\x4\xdd"), result); + } +}; + +CPPUNIT_TEST_SUITE_REGISTRATION(HMACSHA1Test); |