0
0
mirror of https://github.com/zeux/pugixml.git synced 2024-12-27 13:33:17 +08:00

tests: Add a test for stackless write.

This test previously caused a stack overflow on x86/MSVC.

git-svn-id: https://pugixml.googlecode.com/svn/trunk@1015 99668b35-9821-0410-8761-19e4c4f06640
This commit is contained in:
Arseny Kapoulkine 2014-09-21 21:52:13 +00:00
parent 4ed5972d4f
commit 3abba14e72

View File

@ -408,3 +408,22 @@ TEST(write_print_stream_empty_wide)
xml_node().print(oss);
}
#endif
TEST(write_stackless)
{
unsigned int count = 20000;
std::basic_string<pugi::char_t> data;
for (unsigned int i = 0; i < count; ++i)
data += "<a>";
data += "text";
for (unsigned int i = 0; i < count; ++i)
data += "</a>";
xml_document doc;
CHECK(doc.load(data.c_str()));
CHECK_NODE(doc, data.c_str());
}