From a7edb883f08549eba7b9ab5b9f5c12401514fd78 Mon Sep 17 00:00:00 2001 From: Sarat Addepalli Date: Tue, 19 May 2015 12:39:27 +0530 Subject: [PATCH] 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. --- xmltest.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/xmltest.cpp b/xmltest.cpp index b70fc51..4325cb7 100644 --- a/xmltest.cpp +++ b/xmltest.cpp @@ -1460,7 +1460,21 @@ int main( int argc, const char ** argv ) XMLTest( "Error should be cleared", false, doc.Error() ); } - // ----------- Performance tracking -------------- + { + // No matter - before or after successfully parsing a text - + // calling XMLDocument::Value() causes an assert in debug. + const char* validXml = "" + "" + ""; + 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 ) __int64 start, end, freq;