From 3abba14e72d1eaf5578d64b531ca39bd2fdb2d95 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Sun, 21 Sep 2014 21:52:13 +0000 Subject: 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 --- tests/test_write.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'tests') 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 data; + + for (unsigned int i = 0; i < count; ++i) + data += ""; + + data += "text"; + + for (unsigned int i = 0; i < count; ++i) + data += ""; + + xml_document doc; + CHECK(doc.load(data.c_str())); + + CHECK_NODE(doc, data.c_str()); +} -- cgit v1.2.3