From 4920e4fec93b801410b85c894c292a8e982661ba Mon Sep 17 00:00:00 2001 From: "arseny.kapoulkine" Date: Sun, 31 Oct 2010 07:33:01 +0000 Subject: Added xml_document::reset() function with document parameter git-svn-id: http://pugixml.googlecode.com/svn/trunk@786 99668b35-9821-0410-8761-19e4c4f06640 --- tests/test_document.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'tests') diff --git a/tests/test_document.cpp b/tests/test_document.cpp index 342d07c..8796560 100644 --- a/tests/test_document.cpp +++ b/tests/test_document.cpp @@ -906,3 +906,22 @@ TEST(document_reset_empty) CHECK(!doc.first_child()); CHECK_NODE(doc, STR("")); } + +TEST_XML(document_reset_copy, "") +{ + xml_document doc2; + + CHECK_NODE(doc2, STR("")); + + doc2.reset(doc); + + CHECK_NODE(doc2, STR("")); + CHECK(doc.first_child() != doc2.first_child()); + + doc.reset(doc2); + + CHECK_NODE(doc, STR("")); + CHECK(doc.first_child() != doc2.first_child()); + + CHECK(doc.first_child().offset_debug() == -1); +} -- cgit v1.2.3