From 50bc0d5a69afcbad0df8de8f831f6ee58504aa6d Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Mon, 25 Sep 2017 22:54:42 -0700 Subject: tests: Adjust move coverage tests Large test wasn't testing shared parent condition properly - add one more level of hierarchy so that it works as expected. --- tests/test_document.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/test_document.cpp b/tests/test_document.cpp index 3ca69cd..4205949 100644 --- a/tests/test_document.cpp +++ b/tests/test_document.cpp @@ -1715,16 +1715,20 @@ TEST(document_move_large) { xml_document* doc = new xml_document(); + xml_node dn = doc->append_child(STR("node")); + for (int i = 0; i < 3000; ++i) - doc->append_child(STR("node")); + dn.append_child(STR("child")); xml_document other = std::move(*doc); delete doc; + xml_node on = other.child(STR("node")); + for (int i = 0; i < 3000; ++i) - CHECK(other.remove_child(other.first_child())); + CHECK(on.remove_child(on.first_child())); - CHECK(!other.first_child()); + CHECK(!on.first_child()); } TEST_XML(document_move_buffer, "") -- cgit v1.2.3