From: Carl Hetherington Date: Wed, 25 Sep 2013 23:44:50 +0000 (+0100) Subject: More tests. X-Git-Tag: v0.06~1 X-Git-Url: https://git.carlh.net/gitweb/?a=commitdiff_plain;h=c534aeb70d3770b5a081796b7aae1cfef1411cad;hp=3b6ddf4b140befd1286af26c34800a50b3ba3f56;p=libcxml.git More tests. --- diff --git a/test/ref/a.xml b/test/ref/a.xml index 0a37114..e854aae 100644 --- a/test/ref/a.xml +++ b/test/ref/a.xml @@ -5,4 +5,6 @@ yes 1 2 + testingmore testing + jim diff --git a/test/tests.cc b/test/tests.cc index ed8d2f4..90b31cb 100644 --- a/test/tests.cc +++ b/test/tests.cc @@ -61,9 +61,16 @@ BOOST_AUTO_TEST_CASE (test) BOOST_CHECK (document.optional_bool_child("E")); BOOST_CHECK_EQUAL (document.optional_bool_child("E").get(), true); BOOST_CHECK_THROW (document.optional_bool_child("F"), cxml::Error); - BOOST_CHECK (!document.optional_bool_child("G")); BOOST_CHECK_EQUAL (document.node_children("F").size(), 2); BOOST_CHECK_EQUAL (document.node_children("F").front()->content(), "1"); BOOST_CHECK_EQUAL (document.node_children("F").back()->content(), "2"); + + BOOST_CHECK (!document.optional_bool_child("G")); + + BOOST_CHECK_EQUAL (document.node_children("H/I").size(), 2); + BOOST_CHECK_EQUAL (document.node_children("H/I").front()->content(), "testing"); + BOOST_CHECK_EQUAL (document.node_children("H/I").back()->content(), "more testing"); + + BOOST_CHECK_EQUAL (document.string_child("J/K"), "jim"); }