added new test for BOM, and added good defaults for NewDeclaration

This commit is contained in:
Lee Thomason
2012-04-28 14:37:11 -07:00
parent 0aa8a80fd7
commit f68c438ee2
4 changed files with 25 additions and 4 deletions

View File

@@ -813,6 +813,18 @@ int main( int /*argc*/, const char ** /*argv*/ )
ele = docH.FirstChildElement( "none" ).FirstChildElement( "element" ).ToElement();
XMLTest( "Handle, dne, const", false, ele != 0 );
}
{
// Default Declaration & BOM
XMLDocument doc;
doc.InsertEndChild( doc.NewDeclaration() );
doc.SetBOM( true );
XMLPrinter printer;
doc.Print( &printer );
static const char* result = "\xef\xbb\xbf<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
XMLTest( "BOM and default declaration", printer.CStr(), result, false );
}
// ----------- Performance tracking --------------