From 021f025cb039011ad07158b0d94f1b430a409e49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Wed, 26 Oct 2016 21:19:53 +0200 Subject: Refactor the sha1 digest into its own function, and do not use sprintf --- tests/xmpp.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/xmpp.cpp') 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 +#include TEST_CASE("Test basic XML parsing") { @@ -45,3 +46,9 @@ TEST_CASE("XML escape") const std::string unescaped = "'coucou'/&\"gaga\""; CHECK(xml_escape(unescaped) == "'coucou'<cc>/&"gaga""); } + +TEST_CASE("handshake_digest") +{ + const auto res = get_handshake_digest("id1234", "S4CR3T"); + CHECK(res == "c92901b5d376ad56269914da0cce3aab976847df"); +} -- cgit v1.2.3