From f9ee391233ed8526597abb3ffa96c4eb8b1c92ad Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Fri, 16 Jan 2015 21:42:35 -0800 Subject: tests: Add coverage tests for new float setters These only do basic testing to make sure the paths are covered and trivial values work. --- tests/test_dom_text.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'tests/test_dom_text.cpp') diff --git a/tests/test_dom_text.cpp b/tests/test_dom_text.cpp index fb65b03..007334a 100644 --- a/tests/test_dom_text.cpp +++ b/tests/test_dom_text.cpp @@ -263,10 +263,13 @@ TEST_XML(dom_text_assign, "") node.append_child(STR("text6")).text() = 0.5; xml_text() = 0.5; - node.append_child(STR("text7")).text() = true; + node.append_child(STR("text7")).text() = 0.25f; + xml_text() = 0.25f; + + node.append_child(STR("text8")).text() = true; xml_text() = true; - CHECK_NODE(node, STR("v1-2147483647-2147483648429496729542949672940.5true")); + CHECK_NODE(node, STR("v1-2147483647-2147483648429496729542949672940.50.25true")); } TEST_XML(dom_text_set_value, "") @@ -287,10 +290,13 @@ TEST_XML(dom_text_set_value, "") CHECK(node.append_child(STR("text6")).text().set(0.5)); CHECK(!xml_text().set(0.5)); - CHECK(node.append_child(STR("text7")).text().set(true)); + CHECK(node.append_child(STR("text7")).text().set(0.25f)); + CHECK(!xml_text().set(0.25f)); + + CHECK(node.append_child(STR("text8")).text().set(true)); CHECK(!xml_text().set(true)); - CHECK_NODE(node, STR("v1-2147483647-2147483648429496729542949672940.5true")); + CHECK_NODE(node, STR("v1-2147483647-2147483648429496729542949672940.50.25true")); } #ifdef PUGIXML_HAS_LONG_LONG -- cgit v1.2.3