Check an XML tree/subtree or compare two trees/subtrees. For more info about usage see Using XmlCheck.
More...
Protected Attributes |
IEventReceiver * | m_pEventReceiver |
| Interface for receiving all kinds of test events.
|
Private Member Functions |
void | WriteNode (TiXmlNode *in_pNode, unsigned int in_indent, int in_maxChildNodes=0, char const *in_file=0, long in_lineNum=0, FormattedContents *in_pContents=0) |
| Write given XML node to EventReceiver or given optional container.
|
void | WriteAttributes (TiXmlElement *in_pElement, unsigned int in_indent, char const *in_file=0, long in_lineNum=0, FormattedContents *in_pContents=0) |
| Writes attributes of given XML node to EventReceiver.
|
std::string | IfDetailed (std::string const &in_str) |
| Helper function to produce more detailed output.
|
Private Attributes |
EventContext | m_outputMode |
| Output mode for writing XML contents.
|
bool | m_detailedOutput |
| Flag indicating whether the output contains more details.
|
std::set< std::string > | m_attributesToIgnore |
| Set of attribute names to ignore when checking an XML tree.
|
std::set< std::string > | m_nodesToIgnore |
| Set of node names to ignore when checking an XML tree.
|
std::map< std::string, int > | m_doubleAttributes |
| Set of attribute names to be treated as doubles with specific precision.
|
std::map< std::string, int > | m_doubleNodes |
| Set of node names to be treated as doubles with specific precision.
|
std::string | m_compareResult |
| Result of last call to Compare().
|
Static Private Attributes |
static const unsigned int | NUM_INDENTS_PER_SPACE = 2 |
| Indenting to be used when writing an XML tree to test output.
|
Configuration |
|
IEventReceiver * | SetEventReceiver (IEventReceiver *in_pEventReceiver) |
| Define to which destination test events (e.g. failures) are reported.
|
void | SetDefaults (void) |
| Set default values for the following settings.
|
void | SetOutputModeForWritingXmlContents (EventContext in_outputMode) |
| Set output mode for writing XML contents.
|
void | SetDetailedOutput (bool in_detailedOutput) |
| Set amount of data written to test output.
|
void | IgnoreAttribute (std::string const &in_attribute, bool in_ignore=true) |
| Define whether the given attribute shall be ignored when checking XML data.
|
bool | IsAttributeToIgnore (std::string const &in_attribute) const |
| Return whether the given attribute shall be ignored when checking XML data.
|
void | IgnoreNode (std::string const &in_nodeName, bool in_ignore=true) |
| Define whether the given node shall be ignored when checking XML data.
|
bool | IsNodeToIgnore (std::string const &in_nodeName) const |
| Return whether the given node shall be ignored when checking XML data.
|
void | UseAsDoubleAttribute (std::string const &in_attribute, bool in_useAsDouble=true, int in_precision=4) |
| Define whether the given attribute is of type double and in case of type double specify the precision to be used for checking the value.
|
bool | IsDoubleAttribute (std::string const &in_attribute) const |
| Return whether the given attribute is of type double.
|
int | GetPrecisionOfDoubleAttribute (std::string const &in_attribute) const |
| Return the precision used for checking of the given double attribute.
|
void | UseAsDoubleNode (std::string const &in_nodeName, bool in_useAsDouble=true, int in_precision=4) |
| Define whether the given node is of type double and in case of type double specify the precision to be used for checking the value.
|
bool | IsDoubleNode (std::string const &in_nodeName) const |
| Return whether the given node is of type double.
|
int | GetPrecisionOfDoubleNode (std::string const &in_nodeName) const |
| Return the precision used for checking of the given double node.
|
Check XML contents |
|
void | CheckNode (TiXmlNode *in_pNode, char const *in_file=0, long in_lineNum=0) |
| Writes contents of given XML node to EventReceiver. Each attribute and text is reported with a separate call to EventReceiver.
|
void | CheckSubNode (TiXmlNode *in_pNode, std::string const &in_xPathExpression_1, std::string const &in_xPathExpression_2="", std::string const &in_xPathExpression_3="", std::string const &in_xPathExpression_4="", std::string const &in_xPathExpression_5="", char const *in_file=0, long in_lineNum=0) |
| Writes contents of given XML node to EventReceiver. Each attribute and text is reported with a separate call to EventReceiver.
|
void | CheckSubNodeWithMaxChilds (int in_maxChilds, TiXmlNode *in_pNode, std::string const &in_xPathExpression_1, std::string const &in_xPathExpression_2="", std::string const &in_xPathExpression_3="", std::string const &in_xPathExpression_4="", std::string const &in_xPathExpression_5="", char const *in_file=0, long in_lineNum=0) |
| Same as CheckSubNode() but writes contents only for the first in_maxChilds direct child elements of the node identified by the XPath expression(s).
|
bool | Compare (TiXmlNode *in_pNodeA, TiXmlNode *in_pNodeB, char const *in_file=0, long in_lineNum=0) |
| Compares two XML (sub) trees. The result depends on the settings for attributes/nodes to ignore and for the used precision of double values.
|
std::string | GetCompareResult (void) const |
| Get textual description of the last call to Compare.
|
Helper functions |
|
static std::string | GetFullPath (TiXmlNode *in_pNode, std::string const &in_rPathToConcat="") |
| Get the path for the given node.
|
static TiXmlNode * | SubNodeFromXPath (TiXmlNode *in_pParentNode, std::string const &in_xPathExpression_1, std::string const &in_xPathExpression_2="", std::string const &in_xPathExpression_3="", std::string const &in_xPathExpression_4="", std::string const &in_xPathExpression_5="") |
| Get the node from the given parent node and the given path description.
|
Check an XML tree/subtree or compare two trees/subtrees. For more info about usage see Using XmlCheck.