summaryrefslogtreecommitdiff
path: root/tests/test_dom_modify.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_dom_modify.cpp')
-rw-r--r--tests/test_dom_modify.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/test_dom_modify.cpp b/tests/test_dom_modify.cpp
index 5f4e26c..01b562a 100644
--- a/tests/test_dom_modify.cpp
+++ b/tests/test_dom_modify.cpp
@@ -27,6 +27,16 @@ TEST_XML(dom_attr_assign, "<node/>")
CHECK_NODE(node, STR("<node attr1=\"v1\" attr2=\"-2147483647\" attr3=\"-2147483648\" attr4=\"4294967295\" attr5=\"4294967294\" attr6=\"0.5\" attr7=\"true\" />"));
}
+TEST_XML(dom_attr_set_name, "<node attr='value' />")
+{
+ xml_attribute attr = doc.child(STR("node")).attribute(STR("attr"));
+
+ CHECK(attr.set_name(STR("n")));
+ CHECK(!xml_attribute().set_name(STR("n")));
+
+ CHECK_NODE(doc, STR("<node n=\"value\" />"));
+}
+
TEST_XML(dom_attr_set_value, "<node/>")
{
xml_node node = doc.child(STR("node"));
@@ -758,8 +768,9 @@ TEST(dom_node_declaration_name)
doc.insert_child_after(node_declaration, doc.first_child());
doc.insert_child_before(node_declaration, doc.first_child());
+ doc.prepend_child(node_declaration);
- CHECK_NODE(doc, STR("<?xml?><?xml?><?xml?>"));
+ CHECK_NODE(doc, STR("<?xml?><?xml?><?xml?><?xml?>"));
}
TEST(dom_node_declaration_attributes)
@@ -867,17 +878,21 @@ TEST(dom_node_out_of_memory)
// verify all node modification operations
CHECK(!n.append_child());
+ CHECK(!n.prepend_child());
CHECK(!n.insert_child_after(node_element, n.first_child()));
CHECK(!n.insert_child_before(node_element, n.first_child()));
CHECK(!n.append_attribute(STR("")));
+ CHECK(!n.prepend_attribute(STR("")));
CHECK(!n.insert_attribute_after(STR(""), a));
CHECK(!n.insert_attribute_before(STR(""), a));
// verify node copy operations
CHECK(!n.append_copy(n.first_child()));
+ CHECK(!n.prepend_copy(n.first_child()));
CHECK(!n.insert_copy_after(n.first_child(), n.first_child()));
CHECK(!n.insert_copy_before(n.first_child(), n.first_child()));
CHECK(!n.append_copy(a));
+ CHECK(!n.prepend_copy(a));
CHECK(!n.insert_copy_after(a, a));
CHECK(!n.insert_copy_before(a, a));
}