mirror of https://github.com/AxioDL/tinyxml2.git
Test nodes deletion via document
This commit is contained in:
parent
f3f9925f12
commit
e5790dba97
18
xmltest.cpp
18
xmltest.cpp
|
@ -1756,6 +1756,24 @@ int main( int argc, const char ** argv )
|
||||||
doc.DeleteNode(pRoot);
|
doc.DeleteNode(pRoot);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
XMLDocument doc;
|
||||||
|
XMLElement* root = doc.NewElement( "Root" );
|
||||||
|
XMLTest( "Node document before insertion", true, &doc == root->GetDocument() );
|
||||||
|
doc.InsertEndChild( root );
|
||||||
|
XMLTest( "Node document after insertion", true, &doc == root->GetDocument() );
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
// If this doesn't assert in DEBUG, all is well.
|
||||||
|
XMLDocument doc;
|
||||||
|
XMLElement* unlinkedRoot = doc.NewElement( "Root" );
|
||||||
|
XMLElement* linkedRoot = doc.NewElement( "Root" );
|
||||||
|
doc.InsertFirstChild( linkedRoot );
|
||||||
|
unlinkedRoot->GetDocument()->DeleteNode( linkedRoot );
|
||||||
|
unlinkedRoot->GetDocument()->DeleteNode( unlinkedRoot );
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
// Should not assert in DEBUG
|
// Should not assert in DEBUG
|
||||||
XMLPrinter printer;
|
XMLPrinter printer;
|
||||||
|
|
Loading…
Reference in New Issue