CppunitTest_svgio test failure, additional <mask> in dumped XML
Stephan Bergmann
sbergman at redhat.com
Fri Sep 29 07:24:15 UTC 2023
On my Linux machine, CppunitTest_svgio keeps failing with
> xmltesttools.cxx:95:Assertion
> Test name: testTdf97542_1::TestBody
> equality assertion failed
> - Expected: 1
> - Actual : 0
> - In <>, XPath '/primitive2D/transform/objectinfo/textsimpleportion' number of nodes is incorrect
>
> xmltesttools.cxx:95:Assertion
> Test name: testTdf97542_2::TestBody
> equality assertion failed
> - Expected: 1
> - Actual : 0
> - In <>, XPath '/primitive2D/transform/objectinfo/svgradialgradient' number of nodes is incorrect
The problem appears to be that in the XML that
> xmlDocUniquePtr pDocument = dumper.dumpAndParse(Primitive2DContainer(aSequenceTdf97542_1));
dumps out (and then parses in again) there is an unexpected <mask>
element nested in between the expected <transform> and <objectinfo>
elements. That is, the dumped XML (for the first testTdf97542_1, but
similarly also for the second testTdf97542_2) is
> <?xml version="1.0" encoding="UTF-8"?>
> <primitive2D>
> <transform xy11="26" xy12="0" xy13="0" xy21="0" xy22="26" xy23="0" xy31="0" xy32="0" xy33="1">
> <mask>
> <polypolygon height="50" width="200" minx="0" miny="0" maxx="200" maxy="50" path="m0 0h200v50h-200z">
> <polygon>
> <point x="0" y="0"/>
> <point x="200" y="0"/>
> <point x="200" y="50"/>
> <point x="0" y="50"/>
> </polygon>
> </polypolygon>
> <objectinfo>
> <svgradialgradient startx="0" starty="0" radius="0.5" spreadmethod="pad" opacity="1">
> <transform xy11="1" xy12="0" xy13="0" xy21="0" xy22="1" xy23="0" xy31="0" xy32="0" xy33="1"/>
> <polypolygon height="50" width="200" minx="0" miny="0" maxx="200" maxy="50" path="m0 0h200v50h-200z">
> <polygon>
> <point x="0" y="0"/>
> <point x="200" y="0"/>
> <point x="200" y="50"/>
> <point x="0" y="50"/>
> </polygon>
> </polypolygon>
> </svgradialgradient>
> <textsimpleportion width="48" height="48" x="50" y="40" text="Text" fontcolor="#ffff00" familyname="serif"/>
> </objectinfo>
> </mask>
> </transform>
> </primitive2D>
whereas e.g. on my Windows machine it is
> <?xml version="1.0" encoding="UTF-8"?>
> <primitive2D>
> <transform xy11="26" xy12="0" xy13="0" xy21="0" xy22="26" xy23="0" xy31="0" xy32="0" xy33="1">
> <objectinfo>
> <svgradialgradient startx="0" starty="0" radius="0.5" spreadmethod="pad" opacity="1">
> <transform xy11="1" xy12="0" xy13="0" xy21="0" xy22="1" xy23="0" xy31="0" xy32="0" xy33="1"/>
> <polypolygon height="50" width="200" minx="0" miny="0" maxx="200" maxy="50" path="m0 0h200v50h-200z">
> <polygon>
> <point x="0" y="0"/>
> <point x="200" y="0"/>
> <point x="200" y="50"/>
> <point x="0" y="50"/>
> </polygon>
> </polypolygon>
> </svgradialgradient>
> <textsimpleportion width="48" height="48" x="50" y="40" text="Text" fontcolor="#ffff00" familyname="serif"/>
> </objectinfo>
> <hiddengeometry>
> <polygonhairline color="#000000">
> <polygon>0,0 200,0 200,50 0,50</polygon>
> </polygonhairline>
> </hiddengeometry>
> </transform>
> </primitive2D>
(And what would fix the failing tests for me on Linux is
> diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx
> index fcd76f12bd1f..35b295bfba0a 100644
> --- a/svgio/qa/cppunit/SvgImportTest.cxx
> +++ b/svgio/qa/cppunit/SvgImportTest.cxx
> @@ -929,10 +929,10 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf97542_1)
>
> CPPUNIT_ASSERT (pDocument);
>
> - assertXPath(pDocument, "/primitive2D/transform/objectinfo/textsimpleportion", "fontcolor", "#ffff00");
> - assertXPath(pDocument, "/primitive2D/transform/objectinfo/textsimpleportion", "text", "Text");
> - assertXPath(pDocument, "/primitive2D/transform/objectinfo/textsimpleportion", "height", "48");
> - assertXPath(pDocument, "/primitive2D/transform/objectinfo/textsimpleportion", "familyname", "serif");
> + assertXPath(pDocument, "/primitive2D/transform/mask/objectinfo/textsimpleportion", "fontcolor", "#ffff00");
> + assertXPath(pDocument, "/primitive2D/transform/mask/objectinfo/textsimpleportion", "text", "Text");
> + assertXPath(pDocument, "/primitive2D/transform/mask/objectinfo/textsimpleportion", "height", "48");
> + assertXPath(pDocument, "/primitive2D/transform/mask/objectinfo/textsimpleportion", "familyname", "serif");
> }
>
> CPPUNIT_TEST_FIXTURE(Test, testTdf97542_2)
> @@ -945,13 +945,13 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf97542_2)
>
> CPPUNIT_ASSERT (pDocument);
>
> - assertXPath(pDocument, "/primitive2D/transform/objectinfo/svgradialgradient", "startx", "1");
> - assertXPath(pDocument, "/primitive2D/transform/objectinfo/svgradialgradient", "starty", "1");
> - assertXPath(pDocument, "/primitive2D/transform/objectinfo/svgradialgradient/focalx", 0);
> - assertXPath(pDocument, "/primitive2D/transform/objectinfo/svgradialgradient/focaly", 0);
> - assertXPath(pDocument, "/primitive2D/transform/objectinfo/svgradialgradient", "radius", "3");
> - assertXPath(pDocument, "/primitive2D/transform/objectinfo/svgradialgradient", "spreadmethod", "pad");
> - assertXPath(pDocument, "/primitive2D/transform/objectinfo/svgradialgradient", "opacity", "1");
> + assertXPath(pDocument, "/primitive2D/transform/mask/objectinfo/svgradialgradient", "startx", "1");
> + assertXPath(pDocument, "/primitive2D/transform/mask/objectinfo/svgradialgradient", "starty", "1");
> + assertXPath(pDocument, "/primitive2D/transform/mask/objectinfo/svgradialgradient/focalx", 0);
> + assertXPath(pDocument, "/primitive2D/transform/mask/objectinfo/svgradialgradient/focaly", 0);
> + assertXPath(pDocument, "/primitive2D/transform/mask/objectinfo/svgradialgradient", "radius", "3");
> + assertXPath(pDocument, "/primitive2D/transform/mask/objectinfo/svgradialgradient", "spreadmethod", "pad");
> + assertXPath(pDocument, "/primitive2D/transform/mask/objectinfo/svgradialgradient", "opacity", "1");
> }
>
> CPPUNIT_TEST_FIXTURE(Test, testTdf97543)
but which would of course break things for all the other builds that now
succeed.)
Does anybody have an idea what could cause this difference in the dumped
XML?
More information about the LibreOffice
mailing list