summaryrefslogtreecommitdiff
path: root/tests/test_document.cpp
diff options
context:
space:
mode:
authorArseny Kapoulkine <arseny.kapoulkine@gmail.com>2017-01-30 21:36:05 -0800
committerArseny Kapoulkine <arseny.kapoulkine@gmail.com>2017-01-30 21:58:48 -0800
commit02cee98492233f4ae91f025fc38f9df8b4bc0efe (patch)
treed862fa9912ff932b4b4b52a7932d6ae1c814979b /tests/test_document.cpp
parentcac1d8ad9f602e74841acb05596396ee00994ebb (diff)
tests: Add more tests for branch coverage
gcov -b surfaced many lines with partial coverage, where branch is only ever taken or not taken, or one of the expressions in a complex conditional is always either true or false. This change adds a series of tests (mostly focusing on XPath) to reduce the number of partially covered lines.
Diffstat (limited to 'tests/test_document.cpp')
-rw-r--r--tests/test_document.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_document.cpp b/tests/test_document.cpp
index c7219e1..95bd873 100644
--- a/tests/test_document.cpp
+++ b/tests/test_document.cpp
@@ -496,6 +496,15 @@ TEST_XML(document_save_declaration_latin1, "<node/>")
CHECK(writer.as_narrow() == "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n<node />\n");
}
+TEST_XML(document_save_declaration_raw, "<node/>")
+{
+ xml_writer_string writer;
+
+ doc.save(writer, STR(""), pugi::format_raw, get_native_encoding());
+
+ CHECK(writer.as_string() == STR("<?xml version=\"1.0\"?><node/>"));
+}
+
struct temp_file
{
char path[512];