From 0868f83deba4319db2f30f56ccdbc3401ce59f9a Mon Sep 17 00:00:00 2001 From: "arseny.kapoulkine" Date: Sun, 29 Aug 2010 15:45:36 +0000 Subject: tests: Removed some deprecated tests, minor coverage improvements git-svn-id: http://pugixml.googlecode.com/svn/trunk@687 99668b35-9821-0410-8761-19e4c4f06640 --- tests/test_deprecated.cpp | 8 -------- tests/test_document.cpp | 11 +++++++++++ tests/test_dom_traverse.cpp | 1 + 3 files changed, 12 insertions(+), 8 deletions(-) (limited to 'tests') diff --git a/tests/test_deprecated.cpp b/tests/test_deprecated.cpp index 3f7ecb0..5c4f566 100644 --- a/tests/test_deprecated.cpp +++ b/tests/test_deprecated.cpp @@ -25,14 +25,6 @@ #include #include -// format_write_bom_utf8 - it's now format_write_bom! -TEST_XML(document_save_bom_utf8, "") -{ - xml_writer_string writer; - - CHECK(test_save_narrow(doc, pugi::format_no_declaration | pugi::format_raw | pugi::format_write_bom_utf8, encoding_utf8, "\xef\xbb\xbf", 11)); -} - // parse - it's now load_buffer_inplace TEST(document_parse) { diff --git a/tests/test_document.cpp b/tests/test_document.cpp index 37ec021..bb86992 100644 --- a/tests/test_document.cpp +++ b/tests/test_document.cpp @@ -267,6 +267,17 @@ TEST_XML(document_save_declaration, "") CHECK(writer.as_string() == STR("\n\n")); } +TEST(document_save_declaration_empty) +{ + xml_document doc; + + xml_writer_string writer; + + doc.save(writer, STR(""), pugi::format_default, get_native_encoding()); + + CHECK(writer.as_string() == STR("\n")); +} + TEST_XML(document_save_declaration_present_first, "") { doc.insert_child_before(node_declaration, doc.first_child()).append_attribute(STR("encoding")) = STR("utf8"); diff --git a/tests/test_dom_traverse.cpp b/tests/test_dom_traverse.cpp index c647a79..18d59a4 100644 --- a/tests/test_dom_traverse.cpp +++ b/tests/test_dom_traverse.cpp @@ -440,6 +440,7 @@ TEST_XML(dom_node_child_value, "value1v CHECK_STRING(node.child(STR("child2")).child_value(), STR("value2")); CHECK_STRING(node.child(STR("child3")).child_value(), STR("value3")); CHECK_STRING(node.child_value(STR("child3")), STR("value3")); + CHECK_STRING(node.child_value(STR("novalue")), STR("")); } TEST_XML(dom_node_first_last_attribute, "") -- cgit v1.2.3