summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_deprecated.cpp4
-rw-r--r--tests/test_document.cpp5
-rw-r--r--tests/test_dom_modify.cpp10
3 files changed, 17 insertions, 2 deletions
diff --git a/tests/test_deprecated.cpp b/tests/test_deprecated.cpp
index fe88f63..4677fdf 100644
--- a/tests/test_deprecated.cpp
+++ b/tests/test_deprecated.cpp
@@ -208,6 +208,6 @@ TEST_XML(document_order_coverage, "<node id='1'/>")
xml_document doc;
doc.precompute_document_order();
- CHECK(doc.child("node").document_order() == 0);
- CHECK(doc.child("node").attribute("id").document_order() == 0);
+ CHECK(doc.child(STR("node")).document_order() == 0);
+ CHECK(doc.child(STR("node")).attribute(STR("id")).document_order() == 0);
}
diff --git a/tests/test_document.cpp b/tests/test_document.cpp
index 32890e2..3b9c135 100644
--- a/tests/test_document.cpp
+++ b/tests/test_document.cpp
@@ -217,6 +217,11 @@ TEST_XML(document_save_file, "<node/>")
unlink("tests/data/output.xml");
}
+TEST_XML(document_save_file_error, "<node/>")
+{
+ CHECK(!doc.save_file("tests/data/unknown/output.xml"));
+}
+
TEST(document_load_buffer)
{
const pugi::char_t text[] = STR("<?xml?><node/>");
diff --git a/tests/test_dom_modify.cpp b/tests/test_dom_modify.cpp
index 780608f..7d30420 100644
--- a/tests/test_dom_modify.cpp
+++ b/tests/test_dom_modify.cpp
@@ -414,6 +414,16 @@ TEST_XML(dom_node_remove_child_complex, "<node id='1'><n1 id1='1' id2='2'/><n2/>
CHECK_NODE(doc, STR(""));
}
+TEST_XML(dom_node_remove_child_complex_allocated, "<node id='1'><n1 id1='1' id2='2'/><n2/><n3/><child><n4/></child></node>")
+{
+ doc.append_copy(doc.child(STR("node")));
+
+ doc.remove_child(STR("node"));
+ doc.remove_child(STR("node"));
+
+ CHECK_NODE(doc, STR(""));
+}
+
TEST_XML(dom_node_append_copy, "<node>foo<child/></node>")
{
CHECK(xml_node().append_copy(xml_node()) == xml_node());