From d2892be902b9cabe6e3f5732b82f6f2bef8e7d2f Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Thu, 15 Jun 2017 23:52:56 -0700 Subject: tests: Add xml_buffered_writer coverage test This test triggers flush() condition for each optimized write() method. --- tests/test_write.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/test_write.cpp b/tests/test_write.cpp index 5cd92a5..e59b7ab 100644 --- a/tests/test_write.cpp +++ b/tests/test_write.cpp @@ -639,6 +639,30 @@ TEST_XML_FLAGS(write_roundtrip, " pad(bufl - l, STR('v')); + a.set_value(pad.c_str()); + + std::string s = save_narrow(doc, 0, encoding_auto); + CHECK(s.size() == basel + bufl - l); + } +} + #ifndef PUGIXML_NO_EXCEPTIONS struct throwing_writer: pugi::xml_writer { -- cgit v1.2.3