Fix infinite loop bug in ShallowEqual. Fix a warning with a re-interpret cast. Up version to 1.0.4

This commit is contained in:
Lee Thomason (grinliz)
2012-07-01 21:22:53 -07:00
parent a3efec0449
commit 390e978da1
5 changed files with 31 additions and 7 deletions

View File

@@ -793,6 +793,28 @@ int main( int /*argc*/, const char ** /*argv*/ )
XMLTest( "Attribute order (empty)", false, ele->FirstAttribute() ? true : false );
}
{
// Make sure an attribute with a space in it succeeds.
static const char* xml = "<element attribute1=\"Test Attribute\"/>";
XMLDocument doc;
doc.Parse( xml );
XMLElement* ele = doc.FirstChildElement();
XMLTest( "Attribute with space", "Test Attribute", ele->Attribute( "attribute1" ) );
}
{
// Make sure we don't go into an infinite loop.
static const char* xml = "<doc><element attribute='attribute'/><element attribute='attribute'/></doc>";
XMLDocument doc;
doc.Parse( xml );
XMLElement* ele0 = doc.FirstChildElement()->FirstChildElement();
XMLElement* ele1 = ele0->NextSiblingElement();
bool equal = ele0->ShallowEqual( ele1 );
XMLTest( "Infinite loop in shallow equal.", true, equal );
}
// -------- Handles ------------
{
static const char* xml = "<element attrib='bar'><sub>Text</sub></element>";