From f9bbc39bd9a14124c1cba696c99d051a39e34b60 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Sat, 8 Feb 2014 20:36:09 +0000 Subject: Implement long long support if PUGIXML_HAS_LONG_LONG is defined (autodetection is not implemented yet) git-svn-id: http://pugixml.googlecode.com/svn/trunk@962 99668b35-9821-0410-8761-19e4c4f06640 --- tests/test_dom_modify.cpp | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) (limited to 'tests/test_dom_modify.cpp') diff --git a/tests/test_dom_modify.cpp b/tests/test_dom_modify.cpp index 620504a..c7a3989 100644 --- a/tests/test_dom_modify.cpp +++ b/tests/test_dom_modify.cpp @@ -15,7 +15,7 @@ TEST_XML(dom_attr_assign, "") node.append_attribute(STR("attr4")) = 4294967295u; node.append_attribute(STR("attr5")) = 4294967294u; - xml_attribute() = 2147483647; + xml_attribute() = 4294967295u; node.append_attribute(STR("attr6")) = 0.5; xml_attribute() = 0.5; @@ -50,6 +50,38 @@ TEST_XML(dom_attr_set_value, "") CHECK_NODE(node, STR("")); } +#ifdef PUGIXML_HAS_LONG_LONG +TEST_XML(dom_attr_assign_llong, "") +{ + xml_node node = doc.child(STR("node")); + + node.append_attribute(STR("attr1")) = -9223372036854775807ll; + node.append_attribute(STR("attr2")) = -9223372036854775807ll - 1; + xml_attribute() = -9223372036854775807ll - 1; + + node.append_attribute(STR("attr3")) = 18446744073709551615ull; + node.append_attribute(STR("attr4")) = 18446744073709551614ull; + xml_attribute() = 18446744073709551615ull; + + CHECK_NODE(node, STR("")); +} + +TEST_XML(dom_attr_set_value_llong, "") +{ + xml_node node = doc.child(STR("node")); + + CHECK(node.append_attribute(STR("attr1")).set_value(-9223372036854775807ll)); + CHECK(node.append_attribute(STR("attr2")).set_value(-9223372036854775807ll - 1)); + CHECK(!xml_attribute().set_value(-9223372036854775807ll - 1)); + + CHECK(node.append_attribute(STR("attr3")).set_value(18446744073709551615ull)); + CHECK(node.append_attribute(STR("attr4")).set_value(18446744073709551614ull)); + CHECK(!xml_attribute().set_value(18446744073709551615ull)); + + CHECK_NODE(node, STR("")); +} +#endif + TEST_XML(dom_node_set_name, "text") { CHECK(doc.child(STR("node")).set_name(STR("n"))); -- cgit v1.2.3