tests: Add a test for stackless copy
This test has previously caused a stack overflow on x86/MSVC. git-svn-id: https://pugixml.googlecode.com/svn/trunk@1028 99668b35-9821-0410-8761-19e4c4f06640
This commit is contained in:
parent
ddf6db3078
commit
d519f7a473
@ -1242,3 +1242,25 @@ TEST_XML(dom_node_move_tree, "<root><n1 a1='v1'><c1/>t1</n1><n2 a2='v2'><c2/>t2<
|
|||||||
CHECK(n3 == doc.child(STR("n3")));
|
CHECK(n3 == doc.child(STR("n3")));
|
||||||
CHECK(n4 == root.child(STR("n4")));
|
CHECK(n4 == root.child(STR("n4")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(dom_node_copy_stackless)
|
||||||
|
{
|
||||||
|
unsigned int count = 20000;
|
||||||
|
std::basic_string<pugi::char_t> data;
|
||||||
|
|
||||||
|
for (unsigned int i = 0; i < count; ++i)
|
||||||
|
data += STR("<a>");
|
||||||
|
|
||||||
|
data += STR("text");
|
||||||
|
|
||||||
|
for (unsigned int i = 0; i < count; ++i)
|
||||||
|
data += STR("</a>");
|
||||||
|
|
||||||
|
xml_document doc;
|
||||||
|
CHECK(doc.load(data.c_str()));
|
||||||
|
|
||||||
|
xml_document copy;
|
||||||
|
CHECK(copy.append_copy(doc.first_child()));
|
||||||
|
|
||||||
|
CHECK_NODE(doc, data.c_str());
|
||||||
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user