From 09b5dfdcb0707c39874997efbf207ff554334c34 Mon Sep 17 00:00:00 2001 From: "arseny.kapoulkine" Date: Tue, 26 Oct 2010 17:09:34 +0000 Subject: Added xml_document::reset, added append/prepend/insert child overloads for elements (with explicit name) git-svn-id: http://pugixml.googlecode.com/svn/trunk@779 99668b35-9821-0410-8761-19e4c4f06640 --- tests/test_document.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'tests/test_document.cpp') diff --git a/tests/test_document.cpp b/tests/test_document.cpp index f9fcc97..342d07c 100644 --- a/tests/test_document.cpp +++ b/tests/test_document.cpp @@ -876,3 +876,33 @@ TEST_XML_FLAGS(document_element_absent, "", parse_comments) { CHECK(doc.document_element() == xml_node()); } + +TEST_XML(document_reset, "") +{ + CHECK(doc.first_child()); + + doc.reset(); + CHECK(!doc.first_child()); + CHECK_NODE(doc, STR("")); + + doc.reset(); + CHECK(!doc.first_child()); + CHECK_NODE(doc, STR("")); + + CHECK(doc.load(STR(""))); + CHECK(doc.first_child()); + CHECK_NODE(doc, STR("")); + + doc.reset(); + CHECK(!doc.first_child()); + CHECK_NODE(doc, STR("")); +} + +TEST(document_reset_empty) +{ + xml_document doc; + + doc.reset(); + CHECK(!doc.first_child()); + CHECK_NODE(doc, STR("")); +} -- cgit v1.2.3