tests: Removed some deprecated tests, minor coverage improvements

git-svn-id: http://pugixml.googlecode.com/svn/trunk@687 99668b35-9821-0410-8761-19e4c4f06640
This commit is contained in:
arseny.kapoulkine 2010-08-29 15:45:36 +00:00
parent c1bc7a30c3
commit 0868f83deb
3 changed files with 12 additions and 8 deletions

View file

@ -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)
{

View file

@ -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");

View file

@ -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'/>")