summaryrefslogtreecommitdiff
path: root/src/test.cpp
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2013-12-11 21:22:06 +0100
committerFlorent Le Coz <louiz@louiz.org>2013-12-15 00:34:30 +0100
commit7d8ce3b5638b8e09313a6218014a307ab98e6289 (patch)
treeaa6e6b2172d05037a710b314ad8b55c45d48dd29 /src/test.cpp
parent3960e4d5afa09c299f595b411ee8522db30580fd (diff)
downloadbiboumi-7d8ce3b5638b8e09313a6218014a307ab98e6289.tar.gz
biboumi-7d8ce3b5638b8e09313a6218014a307ab98e6289.tar.bz2
biboumi-7d8ce3b5638b8e09313a6218014a307ab98e6289.tar.xz
biboumi-7d8ce3b5638b8e09313a6218014a307ab98e6289.zip
Use XML-sanitized strings when serializing stanzas for the XMPP server
Diffstat (limited to 'src/test.cpp')
-rw-r--r--src/test.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/test.cpp b/src/test.cpp
index 958e894..c9427f0 100644
--- a/src/test.cpp
+++ b/src/test.cpp
@@ -97,6 +97,14 @@ int main()
});
xml.feed(doc.data(), doc.size(), true);
+ const std::string doc2 = "<stream xmlns='s'><stanza>coucou\r\n\a</stanza></stream>";
+ xml.add_stanza_callback([](const Stanza& stanza)
+ {
+ std::cout << stanza.to_string() << std::endl;
+ assert(stanza.get_inner() == "coucou\r\n");
+ });
+ xml.feed(doc2.data(), doc.size(), true);
+
/**
* XML escape/escape
*/