summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2016-10-26 21:19:53 +0200
committerlouiz’ <louiz@louiz.org>2016-10-26 21:19:53 +0200
commit021f025cb039011ad07158b0d94f1b430a409e49 (patch)
tree188231fe10edbf0f9198aa112348bf62842765c7 /tests
parent3fdae6b6249dd2727578fba8bf84e3a7593d9009 (diff)
downloadbiboumi-021f025cb039011ad07158b0d94f1b430a409e49.tar.gz
biboumi-021f025cb039011ad07158b0d94f1b430a409e49.tar.bz2
biboumi-021f025cb039011ad07158b0d94f1b430a409e49.tar.xz
biboumi-021f025cb039011ad07158b0d94f1b430a409e49.zip
Refactor the sha1 digest into its own function, and do not use sprintf
Diffstat (limited to 'tests')
-rw-r--r--tests/xmpp.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/xmpp.cpp b/tests/xmpp.cpp
index 6aab8c4..37d2b54 100644
--- a/tests/xmpp.cpp
+++ b/tests/xmpp.cpp
@@ -1,6 +1,7 @@
#include "catch.hpp"
#include <xmpp/xmpp_parser.hpp>
+#include <xmpp/auth.hpp>
TEST_CASE("Test basic XML parsing")
{
@@ -45,3 +46,9 @@ TEST_CASE("XML escape")
const std::string unescaped = "'coucou'<cc>/&\"gaga\"";
CHECK(xml_escape(unescaped) == "&apos;coucou&apos;&lt;cc&gt;/&amp;&quot;gaga&quot;");
}
+
+TEST_CASE("handshake_digest")
+{
+ const auto res = get_handshake_digest("id1234", "S4CR3T");
+ CHECK(res == "c92901b5d376ad56269914da0cce3aab976847df");
+}