diff options
author | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2017-09-25 22:54:42 -0700 |
---|---|---|
committer | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2017-09-25 22:54:42 -0700 |
commit | 50bc0d5a69afcbad0df8de8f831f6ee58504aa6d (patch) | |
tree | cdb07759cf2bfc33a67872e0f5a316f78362994b /tests | |
parent | 26ead385a782934bbc5b2485bb9f3b71802e645c (diff) |
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.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_document.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
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, "<node1/><node2/>") |