diff options
author | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2017-01-31 20:36:59 -0800 |
---|---|---|
committer | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2017-01-31 20:40:50 -0800 |
commit | 1a3e92a7cc80a719efd988f14860a1aa9692d584 (patch) | |
tree | c37cc873bc9ecaaee551b5b326c15c589269f1e5 /tests/test_compact.cpp | |
parent | 094a0c8ebe44a1bfeb8575b33138a8b258bf8f4b (diff) |
tests: Add more tests to increase coverage
This change adds more thorough tests for attribute conversion as well as
some assorted tests that fix gaps in coverage.
Diffstat (limited to 'tests/test_compact.cpp')
-rw-r--r-- | tests/test_compact.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/test_compact.cpp b/tests/test_compact.cpp index 7c90d07..f9560c9 100644 --- a/tests/test_compact.cpp +++ b/tests/test_compact.cpp @@ -11,15 +11,19 @@ static void overflow_hash_table(xml_document& doc) CHECK(n.prepend_child(node_element)); } -TEST_XML(compact_out_of_memory_string, "<n/>") +TEST_XML_FLAGS(compact_out_of_memory_string, "<n a='v'/><?n v?>", parse_pi) { test_runner::_memory_fail_threshold = 1; overflow_hash_table(doc); - xml_node n = doc.child(STR("n")); + xml_attribute a = doc.child(STR("n")).attribute(STR("a")); + xml_node pi = doc.last_child(); - CHECK_ALLOC_FAIL(CHECK(!n.set_name(STR("name")))); + CHECK_ALLOC_FAIL(CHECK(!pi.set_name(STR("name")))); + CHECK_ALLOC_FAIL(CHECK(!pi.set_value(STR("value")))); + CHECK_ALLOC_FAIL(CHECK(!a.set_name(STR("name")))); + CHECK_ALLOC_FAIL(CHECK(!a.set_value(STR("value")))); } TEST_XML(compact_out_of_memory_attribute, "<n a='v'/>") |