Merge branch 'master' of https://github.com/netcan/tinyxml2 into netcan-master

This commit is contained in:
Lee Thomason
2020-06-13 17:26:30 -07:00
3 changed files with 30 additions and 5 deletions

View File

@@ -1674,6 +1674,24 @@ int main( int argc, const char ** argv )
XMLTest("FloatText()) test", true, test6);
}
{
//API:IntText(),UnsignedText(),Int64Text(), hex value test
const char* xml = "<point> <IntText> -0x2020</IntText> <UnsignedText>0x2020</UnsignedText> \
<Int64Text> +0x1234</Int64Text></point>";
XMLDocument doc;
doc.Parse(xml);
const XMLElement* pointElement = doc.RootElement();
int test1 = pointElement->FirstChildElement("IntText")->IntText();
XMLTest("IntText() hex value test", -0x2020, test1);
unsigned test2 = pointElement->FirstChildElement("UnsignedText")->UnsignedText();
XMLTest("UnsignedText() hex value test", static_cast<unsigned>(0x2020), test2);
int64_t test3 = pointElement->FirstChildElement("Int64Text")->Int64Text();
XMLTest("Int64Text() hex value test", static_cast<int64_t>(+0x1234), test3);
}
{
//API:ShallowEqual() test
const char* xml = "<playlist id = 'playlist'>"