summaryrefslogtreecommitdiff
path: root/svgio/qa/cppunit
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2024-04-24 10:41:59 +0500
committerMike Kaganski <mike.kaganski@collabora.com>2024-04-24 09:43:30 +0200
commitd984836834e67b5bcd618ebd5d1633138985a881 (patch)
treeed919c019a174685aa5fc63e8f3a23e0284fa9c3 /svgio/qa/cppunit
parent9ad0eb9a62b572b15ae0bfd31674aedd77eb4761 (diff)
Fix unit test after commit 98935eef13c7d755221d79fe7d3c5869a40a7c37
Similar to commit cfa9990d470b10548c7fed64eb1182fea11d41e0 (Enable this test on all platforms. 2024-04-20), it seems that 'mask' gets exported inconsistently. This patch workarouns the problem; a proper fix would be finding the real cause. Change-Id: I94c89442aa0385262fba67ec58c9d8d12ffbea27 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166573 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'svgio/qa/cppunit')
-rw-r--r--svgio/qa/cppunit/SvgImportTest.cxx18
1 files changed, 11 insertions, 7 deletions
diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx
index ee9a61deebc3..080580fd8589 100644
--- a/svgio/qa/cppunit/SvgImportTest.cxx
+++ b/svgio/qa/cppunit/SvgImportTest.cxx
@@ -1585,16 +1585,20 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf160773)
{
xmlDocUniquePtr pDocument = dumpAndParseSvg(u"/svgio/qa/cppunit/data/tdf160773.svg");
+ const bool hasMask = countXPathNodes(pDocument, "/primitive2D/transform/mask"_ostr) > 0;
+ const OString aXPath = hasMask ? "/primitive2D/transform/mask/transform"_ostr
+ : "/primitive2D/transform/transform"_ostr;
+
// tdf#160773 Check there is a rectangle
- assertXPath(pDocument, "/primitive2D/transform/transform/polypolygoncolor"_ostr, "color"_ostr, "#ff0000");
+ assertXPath(pDocument, aXPath + "/polypolygoncolor", "color"_ostr, "#ff0000");
// tdf#159661 Check there is text in the right position
- assertXPath(pDocument, "/primitive2D/transform/transform/textsimpleportion"_ostr, 1);
- assertXPath(pDocument, "/primitive2D/transform/transform/textsimpleportion"_ostr, "x"_ostr, "0");
- assertXPath(pDocument, "/primitive2D/transform/transform/textsimpleportion"_ostr, "y"_ostr, "1");
- assertXPath(pDocument, "/primitive2D/transform/transform/textsimpleportion"_ostr, "height"_ostr, "0");
- assertXPath(pDocument, "/primitive2D/transform/transform/textsimpleportion"_ostr, "width"_ostr, "0");
- assertXPath(pDocument, "/primitive2D/transform/transform/textsimpleportion"_ostr, "text"_ostr, "Red");
+ assertXPath(pDocument, aXPath + "/textsimpleportion"_ostr, 1);
+ assertXPath(pDocument, aXPath + "/textsimpleportion"_ostr, "x"_ostr, "0");
+ assertXPath(pDocument, aXPath + "/textsimpleportion"_ostr, "y"_ostr, "1");
+ assertXPath(pDocument, aXPath + "/textsimpleportion"_ostr, "height"_ostr, "0");
+ assertXPath(pDocument, aXPath + "/textsimpleportion"_ostr, "width"_ostr, "0");
+ assertXPath(pDocument, aXPath + "/textsimpleportion"_ostr, "text"_ostr, "Red");
}
CPPUNIT_TEST_FIXTURE(Test, testTdf156271)