summaryrefslogtreecommitdiff
path: root/src/test.cpp
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2013-12-11 21:07:39 +0100
committerFlorent Le Coz <louiz@louiz.org>2013-12-15 00:34:13 +0100
commit3960e4d5afa09c299f595b411ee8522db30580fd (patch)
tree74a94c7c16e35e09e20c0bca5f40db10eab9f664 /src/test.cpp
parentb29290f73a24f2d5af7bde45c9ff5332c7a1f5a6 (diff)
downloadbiboumi-3960e4d5afa09c299f595b411ee8522db30580fd.tar.gz
biboumi-3960e4d5afa09c299f595b411ee8522db30580fd.tar.bz2
biboumi-3960e4d5afa09c299f595b411ee8522db30580fd.tar.xz
biboumi-3960e4d5afa09c299f595b411ee8522db30580fd.zip
Functions to provide xml-valid strings
By removing invalid chars, see http://www.w3.org/TR/xml/#charsets
Diffstat (limited to 'src/test.cpp')
-rw-r--r--src/test.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/test.cpp b/src/test.cpp
index a8c0276..958e894 100644
--- a/src/test.cpp
+++ b/src/test.cpp
@@ -52,6 +52,11 @@ int main()
assert(from_ascii == "couc�ou");
std::cout << from_ascii << std::endl;
+ std::string without_ctrl_char("𤭢€¢$");
+ assert(utils::remove_invalid_xml_chars(without_ctrl_char) == without_ctrl_char);
+ assert(utils::remove_invalid_xml_chars(in) == in);
+ assert(utils::remove_invalid_xml_chars("\acouco\u0008u\uFFFEt\uFFFFe\r\n♥") == "coucoute\r\n♥");
+
/**
* Utils
*/
@@ -156,7 +161,7 @@ int main()
/**
* Config
*/
- std::cout << color << "Testing JID parsing…" << reset << std::endl;
+ std::cout << color << "Testing config…" << reset << std::endl;
Config::filename = "test.cfg";
Config::file_must_exist = false;
Config::set("coucou", "bonjour");