From 50daa32fc27423dec2686543470200e57b27207f Mon Sep 17 00:00:00 2001 From: Lee Thomason Date: Sat, 10 Aug 2019 18:00:57 -0700 Subject: [PATCH] minor fixes to test cases --- xmltest.cpp | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/xmltest.cpp b/xmltest.cpp index afb764c..5a07547 100755 --- a/xmltest.cpp +++ b/xmltest.cpp @@ -1550,32 +1550,32 @@ int main( int argc, const char ** argv ) XMLTest( "Ill formed XML", true, doc.Error() ); } - { - //API:IntText(),UnsignedText(),Int64Text(),DoubleText(),BoolText() and FloatText() test - const char* xml = " -24 42 \ + { + //API:IntText(),UnsignedText(),Int64Text(),DoubleText(),BoolText() and FloatText() test + const char* xml = " -24 42 \ 38 true 2.35 "; - XMLDocument doc; - doc.Parse( xml ); - const XMLElement* pointElement = doc.RootElement(); - int test1; - test1 = pointElement->FirstChildElement("IntText")->IntText(); - XMLTest( "IntText() test",-24,test1); - unsigned test2; - test2 = pointElement->FirstChildElement("UnsignedText")->UnsignedText(); - XMLTest( "UnsignedText() test",42,test2); - int64_t test3; - test3 = pointElement->FirstChildElement("Int64Text")->Int64Text(); - XMLTest( "Int64Text() test",38,test3); - double test4; - test4 = pointElement->FirstChildElement("DoubleText")->DoubleText(); - XMLTest( "DoubleText() test",2.35,test4); - float test5; - test5 = pointElement->FirstChildElement("DoubleText")->FloatText(); - XMLTest( "FloatText()) test",2.35,test5); - bool test6; - test6 = pointElement->FirstChildElement("BoolText")->BoolText(); - XMLTest( "FloatText()) test",true,test6); - } + XMLDocument doc; + doc.Parse(xml); + + const XMLElement* pointElement = doc.RootElement(); + int test1 = pointElement->FirstChildElement("IntText")->IntText(); + XMLTest("IntText() test", -24, test1); + + unsigned test2 = pointElement->FirstChildElement("UnsignedText")->UnsignedText(); + XMLTest("UnsignedText() test", static_cast(42), test2); + + int64_t test3 = pointElement->FirstChildElement("Int64Text")->Int64Text(); + XMLTest("Int64Text() test", static_cast(38), test3); + + double test4 = pointElement->FirstChildElement("DoubleText")->DoubleText(); + XMLTest("DoubleText() test", 2.35, test4); + + float test5 = pointElement->FirstChildElement("DoubleText")->FloatText(); + XMLTest("FloatText()) test", 2.35f, test5); + + bool test6 = pointElement->FirstChildElement("BoolText")->BoolText(); + XMLTest("FloatText()) test", true, test6); + } { //API:ShallowEqual() test