diff options
author | Jan Holesovsky <kendy@collabora.com> | 2014-03-05 12:01:21 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2014-03-05 12:06:02 +0100 |
commit | 27e57531b48afa7bf0c95418a89811c375a96c32 (patch) | |
tree | be4f9f173e37ee306f16f7e45454f0ff9cf3245b /sw/qa/extras/inc | |
parent | e5107024bd2703122c4d8a27e29abd2c73e6af38 (diff) |
sw tests: Fix description of the new assertXPathContent() and use it broadly.
Change-Id: I3c8d5e491fcf9f871d72fb2d138bb7094ff69746
Diffstat (limited to 'sw/qa/extras/inc')
-rw-r--r-- | sw/qa/extras/inc/swmodeltestbase.hxx | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx b/sw/qa/extras/inc/swmodeltestbase.hxx index cb15d695ac8f..77c32c263931 100644 --- a/sw/qa/extras/inc/swmodeltestbase.hxx +++ b/sw/qa/extras/inc/swmodeltestbase.hxx @@ -580,21 +580,20 @@ protected: nNumberOfNodes, xmlXPathNodeSetGetLength(pXmlNodes)); } - /** - * Assert that rXPath exists, and returns exactly nNumberOfNodes nodes. - * Useful for checking that we do _not_ export some node (nNumberOfNodes == 0). + * Assert that rXPath exists, and its content equals rContent. */ void assertXPathContent(xmlDocPtr pXmlDoc, const OString& rXPath, const OUString& rContent) { xmlNodeSetPtr pXmlNodes = getXPathNode(pXmlDoc, rXPath); - CPPUNIT_ASSERT_EQUAL_MESSAGE(OString("XPath '" + rXPath + "' not found").getStr(), - 1, xmlXPathNodeSetGetLength(pXmlNodes)); + CPPUNIT_ASSERT_MESSAGE(OString("XPath '" + rXPath + "' not found").getStr(), + xmlXPathNodeSetGetLength(pXmlNodes) > 0); xmlNodePtr pXmlNode = pXmlNodes->nodeTab[0]; - OUString contents = OUString::createFromAscii((const char*)((pXmlNode->children[0]).content)); - CPPUNIT_ASSERT_EQUAL_MESSAGE("XPath contents do not match",rContent,contents); + + CPPUNIT_ASSERT_EQUAL_MESSAGE("XPath contents of child does not match", rContent, + OUString::createFromAscii((const char*)((pXmlNode->children[0]).content))); } /** |