summaryrefslogtreecommitdiff
path: root/tests/test_parse.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_parse.cpp')
-rw-r--r--tests/test_parse.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_parse.cpp b/tests/test_parse.cpp
index 7bb2663..3ae96d1 100644
--- a/tests/test_parse.cpp
+++ b/tests/test_parse.cpp
@@ -926,6 +926,15 @@ TEST(parse_out_of_memory_halfway_attr)
CHECK_STRING(doc.first_child().last_attribute().name(), STR("a"));
}
+TEST(parse_out_of_memory_conversion)
+{
+ test_runner::_memory_fail_threshold = 256;
+
+ xml_document doc;
+ CHECK(doc.load_buffer("<foo\x90/>", 7, parse_default, encoding_latin1).status == status_out_of_memory);
+ CHECK(!doc.first_child());
+}
+
static bool test_offset(const char_t* contents, unsigned int options, pugi::xml_parse_status status, ptrdiff_t offset)
{
xml_document doc;