mirror of https://github.com/AxioDL/tinyxml2.git
Merge pull request #626 from Dmitry-Me/betterTestDeletionLoop
Better test deletion loop
This commit is contained in:
commit
dd4034c518
36
xmltest.cpp
36
xmltest.cpp
|
@ -2025,19 +2025,29 @@ int main( int argc, const char ** argv )
|
|||
XMLElement* playlist = doc.FirstChildElement("playlist");
|
||||
XMLTest("Crash bug parsing", true, playlist != 0);
|
||||
|
||||
tinyxml2::XMLElement* entry = playlist->FirstChildElement("entry");
|
||||
XMLTest("Crash bug parsing", true, entry != 0);
|
||||
while (entry) {
|
||||
tinyxml2::XMLElement* todelete = entry;
|
||||
entry = entry->NextSiblingElement("entry");
|
||||
playlist->DeleteChild(todelete);
|
||||
};
|
||||
tinyxml2::XMLElement* blank = playlist->FirstChildElement("blank");
|
||||
while (blank) {
|
||||
tinyxml2::XMLElement* todelete = blank;
|
||||
blank = blank->NextSiblingElement("blank");
|
||||
playlist->DeleteChild(todelete);
|
||||
};
|
||||
{
|
||||
const char* elementName = "entry";
|
||||
XMLElement* entry = playlist->FirstChildElement(elementName);
|
||||
XMLTest("Crash bug parsing", true, entry != 0);
|
||||
while (entry) {
|
||||
XMLElement* todelete = entry;
|
||||
entry = entry->NextSiblingElement(elementName);
|
||||
playlist->DeleteChild(todelete);
|
||||
}
|
||||
entry = playlist->FirstChildElement(elementName);
|
||||
XMLTest("Crash bug parsing", true, entry == 0);
|
||||
}
|
||||
{
|
||||
const char* elementName = "blank";
|
||||
XMLElement* blank = playlist->FirstChildElement(elementName);
|
||||
XMLTest("Crash bug parsing", true, blank != 0);
|
||||
while (blank) {
|
||||
XMLElement* todelete = blank;
|
||||
blank = blank->NextSiblingElement(elementName);
|
||||
playlist->DeleteChild(todelete);
|
||||
}
|
||||
XMLTest("Crash bug parsing", true, blank == 0);
|
||||
}
|
||||
|
||||
tinyxml2::XMLPrinter printer;
|
||||
const bool acceptResult = playlist->Accept(&printer);
|
||||
|
|
Loading…
Reference in New Issue