From df6f466e153f5750d75b4176756af0c0a74cb7dc Mon Sep 17 00:00:00 2001 From: "arseny.kapoulkine" Date: Sun, 23 May 2010 07:43:07 +0000 Subject: tests: Minor addition to attribute value modification tests git-svn-id: http://pugixml.googlecode.com/svn/trunk@443 99668b35-9821-0410-8761-19e4c4f06640 --- tests/test_dom_modify.cpp | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) (limited to 'tests') diff --git a/tests/test_dom_modify.cpp b/tests/test_dom_modify.cpp index cb4a5ab..b45dab1 100644 --- a/tests/test_dom_modify.cpp +++ b/tests/test_dom_modify.cpp @@ -2,48 +2,52 @@ #include -TEST_XML(dom_attr_assign, "") +TEST_XML(dom_attr_assign, "") { xml_node node = doc.child(STR("node")); - node.attribute(STR("attr1")) = STR("v1"); + node.append_attribute(STR("attr1")) = STR("v1"); xml_attribute() = STR("v1"); - node.attribute(STR("attr2")) = -2147483647 - 1; + node.append_attribute(STR("attr2")) = -2147483647; + node.append_attribute(STR("attr3")) = -2147483647 - 1; xml_attribute() = -2147483647 - 1; - node.attribute(STR("attr3")) = 2147483647u; + node.append_attribute(STR("attr4")) = 4294967295u; + node.append_attribute(STR("attr5")) = 4294967294u; xml_attribute() = 2147483647; - node.attribute(STR("attr4")) = 0.5; + node.append_attribute(STR("attr6")) = 0.5; xml_attribute() = 0.5; - node.attribute(STR("attr5")) = true; + node.append_attribute(STR("attr7")) = true; xml_attribute() = true; - CHECK_NODE(node, STR("")); + CHECK_NODE(node, STR("")); } -TEST_XML(dom_attr_set_value, "") +TEST_XML(dom_attr_set_value, "") { xml_node node = doc.child(STR("node")); - CHECK(node.attribute(STR("attr1")).set_value(STR("v1"))); + CHECK(node.append_attribute(STR("attr1")).set_value(STR("v1"))); CHECK(!xml_attribute().set_value(STR("v1"))); - CHECK(node.attribute(STR("attr2")).set_value(-2147483647 - 1)); - CHECK(!xml_attribute().set_value(-2147483647 - 1)); + CHECK(node.append_attribute(STR("attr2")).set_value(-2147483647)); + CHECK(node.append_attribute(STR("attr3")).set_value(-2147483647 - 1)); + CHECK(!xml_attribute().set_value(-2147483647)); - CHECK(node.attribute(STR("attr3")).set_value(4294967295u)); + CHECK(node.append_attribute(STR("attr4")).set_value(4294967295u)); + CHECK(node.append_attribute(STR("attr5")).set_value(4294967294u)); CHECK(!xml_attribute().set_value(4294967295u)); - CHECK(node.attribute(STR("attr4")).set_value(0.5)); + CHECK(node.append_attribute(STR("attr6")).set_value(0.5)); CHECK(!xml_attribute().set_value(0.5)); - CHECK(node.attribute(STR("attr5")).set_value(true)); + CHECK(node.append_attribute(STR("attr7")).set_value(true)); CHECK(!xml_attribute().set_value(true)); - CHECK_NODE(node, STR("")); + CHECK_NODE(node, STR("")); } TEST_XML(dom_node_set_name, "text") -- cgit v1.2.3