aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArseny Kapoulkine <arseny.kapoulkine@gmail.com>2018-07-30 07:32:09 -0700
committerArseny Kapoulkine <arseny.kapoulkine@gmail.com>2018-07-30 07:32:09 -0700
commit6b9c07e6ed724b82fe601d6f47c33b71eda7a444 (patch)
tree45f9fc918c75c6ae005a1a9b3c532fb048440e18
parent514478d1f8fad73249a1ab6aab63450ab7723084 (diff)
downloadpugixml-6b9c07e6ed724b82fe601d6f47c33b71eda7a444.zip
pugixml-6b9c07e6ed724b82fe601d6f47c33b71eda7a444.tar.gz
pugixml-6b9c07e6ed724b82fe601d6f47c33b71eda7a444.tar.bz2
tests: Allow document_load_file_special_folder to load empty document
On some Debian systems it looks like we *can* open the current folder as a file and read its contents, but parsing the result produces an empty document. We now handle this case as well. Fixes #225.
-rw-r--r--tests/test_document.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/test_document.cpp b/tests/test_document.cpp
index a909007..310eba9 100644
--- a/tests/test_document.cpp
+++ b/tests/test_document.cpp
@@ -596,7 +596,8 @@ TEST(document_load_file_special_folder)
xml_document doc;
xml_parse_result result = doc.load_file(".");
// status_out_of_memory is somewhat counter-intuitive but on Linux ftell returns LONG_MAX for directories
- CHECK(result.status == status_file_not_found || result.status == status_io_error || result.status == status_out_of_memory);
+ // on some Debian systems the folder is also read as empty, hence status_no_document_element check
+ CHECK(result.status == status_file_not_found || result.status == status_io_error || result.status == status_out_of_memory || result.status == status_no_document_element);
}
#endif