From b0fc587a7fbeb902bb0760dba73ee621105a86bc Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Fri, 20 Oct 2017 21:53:42 -0700 Subject: tests: Add more move tests We now check that appending a child to a moved document performs no allocations - this is already the case, but if we neglected to copy the allocator state this test would fail. --- tests/test_document.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests') diff --git a/tests/test_document.cpp b/tests/test_document.cpp index 4205949..e6b9081 100644 --- a/tests/test_document.cpp +++ b/tests/test_document.cpp @@ -1739,4 +1739,15 @@ TEST_XML(document_move_buffer, "") CHECK(other.child(STR("node2")).offset_debug() == 9); } + +TEST_XML(document_move_append_child_zero_alloc, "") +{ + test_runner::_memory_fail_threshold = 1; + + xml_document other = std::move(doc); + + CHECK(other.append_child(STR("node3"))); + + CHECK_NODE(other, STR("")); +} #endif -- cgit v1.2.3