diff options
author | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2014-09-21 21:52:13 +0000 |
---|---|---|
committer | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2014-09-21 21:52:13 +0000 |
commit | 3abba14e72d1eaf5578d64b531ca39bd2fdb2d95 (patch) | |
tree | 04315339cad55ff99b90445cb6aae988aba99f19 /tests/test_write.cpp | |
parent | 4ed5972d4f832456d08dac6801d35289379dd417 (diff) |
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
Diffstat (limited to 'tests/test_write.cpp')
-rw-r--r-- | tests/test_write.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/test_write.cpp b/tests/test_write.cpp index 465d111..449ad97 100644 --- a/tests/test_write.cpp +++ b/tests/test_write.cpp @@ -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()); +} |