From 6b9c07e6ed724b82fe601d6f47c33b71eda7a444 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Mon, 30 Jul 2018 07:32:09 -0700 Subject: [PATCH] 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. --- tests/test_document.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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