diff options
author | Lee Thomason <leethomason@gmail.com> | 2020-06-13 17:26:30 -0700 |
---|---|---|
committer | Lee Thomason <leethomason@gmail.com> | 2020-06-13 17:26:30 -0700 |
commit | c9c9d8cdfa52647e0991237f37f32714648bc844 (patch) | |
tree | c234cb25654ae74dac46eb5c8f005b542d301bba /xmltest.cpp | |
parent | bfbcc0333d1a24ec8d9e10d14116d00dbdedf043 (diff) | |
parent | dfb45cb73b24fed35c6749e00b3695f3da1ae2a6 (diff) | |
download | tinyxml2-c9c9d8cdfa52647e0991237f37f32714648bc844.tar.gz |
Merge branch 'master' of https://github.com/netcan/tinyxml2 into netcan-master
Diffstat (limited to 'xmltest.cpp')
-rwxr-xr-x | xmltest.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/xmltest.cpp b/xmltest.cpp index adcba6d..aaed91f 100755 --- a/xmltest.cpp +++ b/xmltest.cpp @@ -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'>"
|