mirror of https://github.com/AxioDL/tinyxml2.git
tweak test
This commit is contained in:
parent
224ef775c6
commit
82bb074b49
24
xmltest.cpp
24
xmltest.cpp
|
@ -1758,15 +1758,15 @@ int main( int argc, const char ** argv )
|
||||||
// Crashing reported via email.
|
// Crashing reported via email.
|
||||||
const char* xml =
|
const char* xml =
|
||||||
"<playlist id='playlist1'>"
|
"<playlist id='playlist1'>"
|
||||||
"<property name='track_name'>voice</property>"
|
"<property name='track_name'>voice</property>"
|
||||||
"<property name='audio_track'>1</property>"
|
"<property name='audio_track'>1</property>"
|
||||||
"<entry out = '604' producer = '4_playlist1' in = '0' />"
|
"<entry out = '604' producer = '4_playlist1' in = '0' />"
|
||||||
"<blank length = '1' />"
|
"<blank length = '1' />"
|
||||||
"<entry out = '1625' producer = '3_playlist' in = '0' />"
|
"<entry out = '1625' producer = '3_playlist' in = '0' />"
|
||||||
"<blank length = '2' />"
|
"<blank length = '2' />"
|
||||||
"<entry out = '946' producer = '2_playlist1' in = '0' />"
|
"<entry out = '946' producer = '2_playlist1' in = '0' />"
|
||||||
"<blank length = '1' />"
|
"<blank length = '1' />"
|
||||||
"<entry out = '128' producer = '1_playlist1' in = '0' />"
|
"<entry out = '128' producer = '1_playlist1' in = '0' />"
|
||||||
"</playlist>";
|
"</playlist>";
|
||||||
|
|
||||||
// It's not a good idea to delete elements as you walk the
|
// It's not a good idea to delete elements as you walk the
|
||||||
|
@ -1798,6 +1798,12 @@ int main( int argc, const char ** argv )
|
||||||
printf("%s\n", printer.CStr());
|
printf("%s\n", printer.CStr());
|
||||||
|
|
||||||
// No test; it only need to not crash.
|
// No test; it only need to not crash.
|
||||||
|
// Still, wrap it up with a sanity check
|
||||||
|
int nProperty = 0;
|
||||||
|
for (const XMLElement* p = playlist->FirstChildElement("property"); p; p = p->NextSiblingElement("property")) {
|
||||||
|
nProperty++;
|
||||||
|
}
|
||||||
|
XMLTest("Crash bug parsing", nProperty, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------- Line Number Tracking --------------
|
// ----------- Line Number Tracking --------------
|
||||||
|
|
Loading…
Reference in New Issue