|
|
@@ -120,8 +120,8 @@ bool testSimilarAttributeName() { |
|
|
|
" <stage\n"
|
|
|
|
" name='" + expectedNameAttr + "'\n"
|
|
|
|
" na='" + expectedNaAttr + "'\n"
|
|
|
|
" nameLong='" + expectedNameLongAttr + "'/>"
|
|
|
|
"</elem>";
|
|
|
|
" nameLong='" + expectedNameLongAttr + "'\n"
|
|
|
|
"/></elem>";
|
|
|
|
|
|
|
|
CodeDweller::ConfigurationData confData(xml.data(), xml.size());
|
|
|
|
|
|
|
@@ -145,6 +145,41 @@ bool testSimilarAttributeName() { |
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
bool testNullAttributeValue() {
|
|
|
|
|
|
|
|
std::string xml = "<data name='messageContent' value=''/>";
|
|
|
|
CodeDweller::ConfigurationData confData(xml.data(), xml.size());
|
|
|
|
|
|
|
|
CodeDweller::ConfigurationElement reader("data");
|
|
|
|
std::string nameAttr, valueAttr, setAttr;
|
|
|
|
|
|
|
|
reader
|
|
|
|
.Attribute("name", nameAttr)
|
|
|
|
.Attribute("value", valueAttr, ">")
|
|
|
|
.Attribute("set", setAttr, ">")
|
|
|
|
.End("data");
|
|
|
|
|
|
|
|
reader.initialize();
|
|
|
|
|
|
|
|
if (0 == reader.interpret(confData)) {
|
|
|
|
RETURN_FALSE("Error parsing XML: " + confData.Log.str());
|
|
|
|
}
|
|
|
|
|
|
|
|
if ("messageContent" != nameAttr) {
|
|
|
|
RETURN_FALSE("\"name\" attribute read failure");
|
|
|
|
}
|
|
|
|
|
|
|
|
if ("" != valueAttr) {
|
|
|
|
std::cout << "Expected \"\", got \"" << valueAttr << "\".\n";
|
|
|
|
RETURN_FALSE("\"value\" attribute read failure");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (">" != setAttr) {
|
|
|
|
RETURN_FALSE("\"set\" attribute read failure");
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// End of tests ////////////////////////////////////////////////////////////////
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
@@ -156,6 +191,7 @@ int main() |
|
|
|
|
|
|
|
RUN_TEST(testSimilarElementName);
|
|
|
|
RUN_TEST(testSimilarAttributeName);
|
|
|
|
RUN_TEST(testNullAttributeValue);
|
|
|
|
|
|
|
|
SUMMARY;
|
|
|
|
|