From 0868f83deba4319db2f30f56ccdbc3401ce59f9a Mon Sep 17 00:00:00 2001
From: "arseny.kapoulkine"
 <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>
Date: Sun, 29 Aug 2010 15:45:36 +0000
Subject: [PATCH] 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(-)

diff --git a/tests/test_deprecated.cpp b/tests/test_deprecated.cpp
index 3f7ecb0f..5c4f5663 100644
--- a/tests/test_deprecated.cpp
+++ b/tests/test_deprecated.cpp
@@ -25,14 +25,6 @@
 #include <vector>
 #include <iterator>
 
-// format_write_bom_utf8 - it's now format_write_bom!
-TEST_XML(document_save_bom_utf8, "<node/>")
-{
-	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<node />", 11));
-}
-
 // parse - it's now load_buffer_inplace
 TEST(document_parse)
 {
diff --git a/tests/test_document.cpp b/tests/test_document.cpp
index 37ec0214..bb86992a 100644
--- a/tests/test_document.cpp
+++ b/tests/test_document.cpp
@@ -267,6 +267,17 @@ TEST_XML(document_save_declaration, "<node/>")
 	CHECK(writer.as_string() == STR("<?xml version=\"1.0\"?>\n<node />\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("<?xml version=\"1.0\"?>\n"));
+}
+
 TEST_XML(document_save_declaration_present_first, "<node/>")
 {
 	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 c647a791..18d59a44 100644
--- a/tests/test_dom_traverse.cpp
+++ b/tests/test_dom_traverse.cpp
@@ -440,6 +440,7 @@ TEST_XML(dom_node_child_value, "<node><novalue/><child1>value1</child1><child2>v
 	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, "<node attr1='0' attr2='1'/>")
-- 
GitLab