mirror of
https://github.com/zeux/pugixml.git
synced 2024-12-27 13:33:17 +08:00
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.
This commit is contained in:
parent
50bc0d5a69
commit
b0fc587a7f
@ -1739,4 +1739,15 @@ TEST_XML(document_move_buffer, "<node1/><node2/>")
|
||||
|
||||
CHECK(other.child(STR("node2")).offset_debug() == 9);
|
||||
}
|
||||
|
||||
TEST_XML(document_move_append_child_zero_alloc, "<node1/><node2/>")
|
||||
{
|
||||
test_runner::_memory_fail_threshold = 1;
|
||||
|
||||
xml_document other = std::move(doc);
|
||||
|
||||
CHECK(other.append_child(STR("node3")));
|
||||
|
||||
CHECK_NODE(other, STR("<node1/><node2/><node3/>"));
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user