Add a test case for issue #323

When compiled in "debug mode", this test case verifies that an assert is fired, when `XMLDocument::Value()` is called.
This commit is contained in:
Sarat Addepalli 2015-05-19 12:39:27 +05:30
parent e5e5541af6
commit a7edb883f0

View File

@ -1460,6 +1460,20 @@ int main( int argc, const char ** argv )
XMLTest( "Error should be cleared", false, doc.Error() );
}
{
// No matter - before or after successfully parsing a text -
// calling XMLDocument::Value() causes an assert in debug.
const char* validXml = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>"
"<first />"
"<second />";
XMLDocument* doc = new XMLDocument();
const char* value;
XMLTest( "XMLDocument::Value() fires assert?", NULL, doc->Value() );
doc->Parse( validXml );
XMLTest( "XMLDocument::Value() fires assert?", NULL, doc->Value() );
delete doc;
}
// ----------- Performance tracking --------------
{
#if defined( _MSC_VER )