fix incorrect assert on unused memory
This commit is contained in:
14
xmltest.cpp
14
xmltest.cpp
@@ -1,5 +1,8 @@
|
||||
#include "tinyxml2.h"
|
||||
#if defined( _MSC_VER )
|
||||
#define _CRT_SECURE_NO_WARNINGS // This test file is not intended to be secure.
|
||||
#endif
|
||||
|
||||
#include "tinyxml2.h"
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <ctime>
|
||||
@@ -975,6 +978,15 @@ int main( int /*argc*/, const char ** /*argv*/ )
|
||||
}
|
||||
#endif
|
||||
|
||||
{
|
||||
// An assert should not fire.
|
||||
const char* xml = "<element/>";
|
||||
XMLDocument doc;
|
||||
doc.Parse( xml );
|
||||
XMLElement* ele = doc.NewElement( "unused" ); // This will get cleaned up with the 'doc' going out of scope.
|
||||
XMLTest( "Tracking unused elements", true, ele != 0, false );
|
||||
}
|
||||
|
||||
// ----------- Performance tracking --------------
|
||||
{
|
||||
#if defined( _MSC_VER )
|
||||
|
||||
Reference in New Issue
Block a user