summaryrefslogtreecommitdiff
path: root/src/test.cpp
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2014-05-26 04:22:40 +0200
committerFlorent Le Coz <louiz@louiz.org>2014-05-28 17:40:45 +0200
commit1c93afc9a7ec33d90c81062c3f1077b5cf84c212 (patch)
treecb6bb832454044a1bcdc436a0de4b131f7cf2db6 /src/test.cpp
parenta350caf6e0fb95263e929fde7dd4f58931f0825c (diff)
downloadbiboumi-1c93afc9a7ec33d90c81062c3f1077b5cf84c212.tar.gz
biboumi-1c93afc9a7ec33d90c81062c3f1077b5cf84c212.tar.bz2
biboumi-1c93afc9a7ec33d90c81062c3f1077b5cf84c212.tar.xz
biboumi-1c93afc9a7ec33d90c81062c3f1077b5cf84c212.zip
Change the way the namespaces are handled in the XmlNode class
Diffstat (limited to 'src/test.cpp')
-rw-r--r--src/test.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/test.cpp b/src/test.cpp
index 2b9aca2..e71ea35 100644
--- a/src/test.cpp
+++ b/src/test.cpp
@@ -154,14 +154,15 @@ int main()
xml.add_stanza_callback([](const Stanza& stanza)
{
std::cout << stanza.to_string() << std::endl;
- assert(stanza.get_name() == "stream_ns:stanza");
+ assert(stanza.get_name() == "stanza");
+ assert(stanza.get_tag("xmlns") == "stream_ns");
assert(stanza.get_tag("b") == "c");
assert(stanza.get_inner() == "inner");
assert(stanza.get_tail() == "");
- assert(stanza.get_child("stream_ns:child1") != nullptr);
- assert(stanza.get_child("stream_ns:child2") == nullptr);
- assert(stanza.get_child("child2_ns:child2") != nullptr);
- assert(stanza.get_child("child2_ns:child2")->get_tail() == "tail");
+ assert(stanza.get_child("child1", "stream_ns") != nullptr);
+ assert(stanza.get_child("child2", "stream_ns") == nullptr);
+ assert(stanza.get_child("child2", "child2_ns") != nullptr);
+ assert(stanza.get_child("child2", "child2_ns")->get_tail() == "tail");
});
xml.feed(doc.data(), doc.size(), true);