summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-08-29 15:45:36 +0000
committerarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-08-29 15:45:36 +0000
commit0868f83deba4319db2f30f56ccdbc3401ce59f9a (patch)
tree9df45a243ecf6c33bf2d867c243c05764facfdac
parentc1bc7a30c3c2935d3739919d4f8cdb7a81fe1ee8 (diff)
tests: Removed some deprecated tests, minor coverage improvements
git-svn-id: http://pugixml.googlecode.com/svn/trunk@687 99668b35-9821-0410-8761-19e4c4f06640
-rw-r--r--tests/test_deprecated.cpp8
-rw-r--r--tests/test_document.cpp11
-rw-r--r--tests/test_dom_traverse.cpp1
3 files changed, 12 insertions, 8 deletions
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 <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 37ec021..bb86992 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 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, "<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'/>")