diff options
author | Lee Thomason <leethomason@gmail.com> | 2017-12-28 14:07:47 -0800 |
---|---|---|
committer | Lee Thomason <leethomason@gmail.com> | 2017-12-28 14:07:47 -0800 |
commit | 5b00e0662f54c58641c162d85b0e18785eba8f3a (patch) | |
tree | 1172d9c8806020f53f57dcdeb099502c89bf11bb /xmltest.cpp | |
parent | 4155ac0c7345c760be0b79d44040691a5c4fff06 (diff) | |
download | tinyxml2-5b00e0662f54c58641c162d85b0e18785eba8f3a.tar.gz |
add query string method
Diffstat (limited to 'xmltest.cpp')
-rw-r--r-- | xmltest.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/xmltest.cpp b/xmltest.cpp index 91494ec..046bef7 100644 --- a/xmltest.cpp +++ b/xmltest.cpp @@ -827,6 +827,14 @@ int main( int argc, const char ** argv ) XMLTest("Attribute: unsigned", (int)XML_SUCCESS, queryResult, true);
XMLTest("Attribute: unsigned", unsigned(100), v, true);
}
+ {
+ const char* v = "failed";
+ int queryResult = element->QueryStringAttribute("not-attrib", &v);
+ XMLTest("Attribute: string default", false, queryResult == XML_SUCCESS);
+ queryResult = element->QueryStringAttribute("attrib", &v);
+ XMLTest("Attribute: string", (int)XML_SUCCESS, queryResult, true);
+ XMLTest("Attribute: string", "100", v);
+ }
XMLTest("Attribute: unsigned", unsigned(100), element->UnsignedAttribute("attrib"), true);
}
{
|