ability to set bool write values

This commit is contained in:
Lee Thomason
2016-12-26 16:45:30 -08:00
parent 5b733ff481
commit ce667c9233
3 changed files with 46 additions and 2 deletions

View File

@@ -752,6 +752,18 @@ int main( int argc, const char ** argv )
XMLTest("Attribute: bool", true, v, true);
XMLTest("Attribute: bool", true, element->BoolAttribute("attrib"), true);
}
{
element->SetAttribute("attrib", true);
const char* result = element->Attribute("attrib");
XMLTest("Bool true is 'true'", "true", result);
XMLUtil::SetBool("1", "0");
element->SetAttribute("attrib", true);
result = element->Attribute("attrib");
XMLTest("Bool true is '1'", "1", result);
XMLUtil::SetBool(0, 0);
}
{
element->SetAttribute("attrib", 100.0);
double v = 0;