summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/test_document.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_document.cpp b/tests/test_document.cpp
index bb5ed63..b702a07 100644
--- a/tests/test_document.cpp
+++ b/tests/test_document.cpp
@@ -109,12 +109,26 @@ TEST(document_load_stream_error)
std::ifstream fs("filedoesnotexist");
CHECK(doc.load(fs).status == status_io_error);
+}
+
+TEST(document_load_stream_out_of_memory)
+{
+ pugi::xml_document doc;
std::istringstream iss("<node/>");
test_runner::_memory_fail_threshold = 1;
CHECK_ALLOC_FAIL(CHECK(doc.load(iss).status == status_out_of_memory));
}
+TEST(document_load_stream_wide_out_of_memory)
+{
+ pugi::xml_document doc;
+
+ std::basic_istringstream<wchar_t> iss(L"<node/>");
+ test_runner::_memory_fail_threshold = 1;
+ CHECK_ALLOC_FAIL(CHECK(doc.load(iss).status == status_out_of_memory));
+}
+
TEST(document_load_stream_empty)
{
std::istringstream iss;