summaryrefslogtreecommitdiff
path: root/test/qa/cppunit
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2022-11-25 19:26:46 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2022-11-25 20:57:39 +0100
commitc802c5f390a30a66118f56a01e47772a54743a6a (patch)
tree10294873ba14d82ab801ae5dc5e1d3ca95718cc8 /test/qa/cppunit
parent66e93c7a74af4d7078762ef4f2071e2f8ae15c27 (diff)
Require valid attribute in getXPath
The reason for accepting empty attribute was eliminated in commit 2f91ab025de850fe5af8114565755a8deed55911 (Merge two assertXPath overloads that both check number of nodes, Nov 25 16:36:57 2022) Change-Id: I6cd77eb0f73650dfdafd55946b5269ffe3f0bde5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143304 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'test/qa/cppunit')
-rw-r--r--test/qa/cppunit/test_xpath.cxx6
1 files changed, 2 insertions, 4 deletions
diff --git a/test/qa/cppunit/test_xpath.cxx b/test/qa/cppunit/test_xpath.cxx
index c622e59617ec..599ae8dbcfc1 100644
--- a/test/qa/cppunit/test_xpath.cxx
+++ b/test/qa/cppunit/test_xpath.cxx
@@ -25,15 +25,13 @@ CPPUNIT_TEST_FIXTURE(TestXPath, test_getXPath)
xmlDocUniquePtr pTable(xmlParseDoc(s_xml));
CPPUNIT_ASSERT(pTable);
// Must get existing element content without errors
- CPPUNIT_ASSERT_ASSERTION_PASS(getXPath(pTable, "/xml/item", ""));
+ CPPUNIT_ASSERT_ASSERTION_PASS(assertXPath(pTable, "/xml/item"));
// Must error out when getting non-existing element
- CPPUNIT_ASSERT_ASSERTION_FAIL(getXPath(pTable, "/xml/no_item", ""));
+ CPPUNIT_ASSERT_ASSERTION_FAIL(assertXPath(pTable, "/xml/no_item"));
// Must get existing attribute value correctly
CPPUNIT_ASSERT_ASSERTION_PASS(getXPath(pTable, "/xml/item", "attrib"));
// Must fail when requested non-empty attribute doesn't exist
CPPUNIT_ASSERT_ASSERTION_FAIL(getXPath(pTable, "/xml/item", "no_attrib"));
- // Must return empty string if not asking an attribute, regardless what is its content
- CPPUNIT_ASSERT_EQUAL(OUString(), getXPath(pTable, "/xml/item", ""));
// Must properly return attribute content
CPPUNIT_ASSERT_EQUAL(OUString("val"), getXPath(pTable, "/xml/item", "attrib"));
// Trying to get position of missing child of a node must fail assertion