diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2024-04-23 11:54:47 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2024-04-23 14:05:04 +0200 |
commit | 98935eef13c7d755221d79fe7d3c5869a40a7c37 (patch) | |
tree | eb18c58fa631426f8e616ff918a4a6deb092671a /svgio/qa/cppunit | |
parent | 248c21867cc33f0c135304007c3b113947a39683 (diff) |
tdf#159661, tdf#160773: svgio: Add unittest
Change-Id: I2d0b96f13e02ac81b97ea347889c76770c22a989
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166509
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'svgio/qa/cppunit')
-rw-r--r-- | svgio/qa/cppunit/SvgImportTest.cxx | 16 | ||||
-rw-r--r-- | svgio/qa/cppunit/data/tdf160773.svg | 5 |
2 files changed, 21 insertions, 0 deletions
diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx index 817980d00421..ee9a61deebc3 100644 --- a/svgio/qa/cppunit/SvgImportTest.cxx +++ b/svgio/qa/cppunit/SvgImportTest.cxx @@ -1581,6 +1581,22 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf156837) assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[2]"_ostr, "text"_ostr, "3"); } +CPPUNIT_TEST_FIXTURE(Test, testTdf160773) +{ + xmlDocUniquePtr pDocument = dumpAndParseSvg(u"/svgio/qa/cppunit/data/tdf160773.svg"); + + // tdf#160773 Check there is a rectangle + assertXPath(pDocument, "/primitive2D/transform/transform/polypolygoncolor"_ostr, "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"); +} + CPPUNIT_TEST_FIXTURE(Test, testTdf156271) { xmlDocUniquePtr pDocument = dumpAndParseSvg(u"/svgio/qa/cppunit/data/tdf156271.svg"); diff --git a/svgio/qa/cppunit/data/tdf160773.svg b/svgio/qa/cppunit/data/tdf160773.svg new file mode 100644 index 000000000000..812c0824862c --- /dev/null +++ b/svgio/qa/cppunit/data/tdf160773.svg @@ -0,0 +1,5 @@ +<?xml version="1.0" ?> +<svg width="600px" height="600px" viewBox="0 0 1 1" xmlns="http://www.w3.org/2000/svg"> + <text x="0" y="0.5" font-size="0.2px" dominant-baseline="middle" >Red</text> + <rect x="0.05" y="0.05" fill="#f00" width="0.36" height="0.242" /> +</svg> |