Browse Source

Added testRawData().


git-svn-id: https://svn.microneil.com/svn/CodeDweller-Tests/trunk@58 b3372362-9eaa-4a85-aa2b-6faa1ab7c995
master
adeniz 8 years ago
parent
commit
c3c45e68d8
1 changed files with 42 additions and 0 deletions
  1. 42
    0
      TestXMLReader/testXMLReader.cpp

+ 42
- 0
TestXMLReader/testXMLReader.cpp View File

@@ -121,6 +121,47 @@ bool testEmptyElement() {
}
bool testRawData() {
std::string stageContent;
std::string elementXml, stageXml;
CodeDweller::XMLReaderElement reader("elem");
reader
.RawData(elementXml)
.Element("stage", stageContent)
.RawData(stageXml)
.End("stage")
.End("elem");
std::string xml;
xml = "<elem><stage>Content</stage></elem>";
CodeDweller::XMLReaderData confData(xml.data(), xml.size());
reader.initialize();
if (0 == reader.interpret(confData)) {
RETURN_FALSE("Error parsing XML: " + confData.Log.str());
}
if (elementXml != xml) {
RETURN_FALSE("RawData() failure for root element");
}
if ("<stage>Content</stage>" != stageXml) {
RETURN_FALSE("RawData() failure for child element");
}
if ("Content" != stageContent) {
RETURN_FALSE("content failure for child element");
}
return true;
}
bool testSimilarElementName() {
std::string stageContent, stage1Content, stage2Content;
@@ -502,6 +543,7 @@ int main()
<< std::endl;
RUN_TEST(testEmptyElement);
RUN_TEST(testRawData);
RUN_TEST(testSimilarElementName);
RUN_TEST(testSimilarAttributeName);
RUN_TEST(testHugeAttributeValue);

Loading…
Cancel
Save