summaryrefslogtreecommitdiff
path: root/src/test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/test.cpp')
-rw-r--r--src/test.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test.cpp b/src/test.cpp
index 99454a5..7818451 100644
--- a/src/test.cpp
+++ b/src/test.cpp
@@ -12,6 +12,7 @@
#include <config/config.hpp>
+#include <xmpp/jid.hpp>
#include <xmpp/xmpp_parser.hpp>
int main()
@@ -66,6 +67,23 @@ int main()
xml.feed(doc.data(), doc.size(), true);
/**
+ * JID parsing
+ */
+ // Full JID
+ Jid jid1("♥@ツ.coucou/coucou@coucou/coucou");
+ std::cerr << jid1.local << " @ " << jid1.domain << " / " << jid1.resource << std::endl;
+ assert(jid1.local == "♥");
+ assert(jid1.domain == "ツ.coucou");
+ assert(jid1.resource == "coucou@coucou/coucou");
+
+ // Domain and resource
+ Jid jid2("ツ.coucou/coucou@coucou/coucou");
+ std::cerr << jid2.local << " @ " << jid2.domain << " / " << jid2.resource << std::endl;
+ assert(jid2.local == "");
+ assert(jid2.domain == "ツ.coucou");
+ assert(jid2.resource == "coucou@coucou/coucou");
+
+ /**
* Config
*/
Config::filename = "test.cfg";