svgio/qa/cppunit/SvgImportTest.cxx | 16 ++++++++++++++++ svgio/qa/cppunit/data/tdf97936.svg | 5 +++++ 2 files changed, 21 insertions(+)
New commits: commit 6afec8e461aee826664347adf234a81228a69a45 Author: Xisco Fauli <aniste...@gmail.com> Date: Wed Feb 24 23:40:25 2016 +0100 tdf#97936: SVGIO: Add unittest Change-Id: I7adb55dc408811f03365578f815bf1b7fbe7f2fd Reviewed-on: https://gerrit.libreoffice.org/22679 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Xisco Faulà <aniste...@gmail.com> diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx index 801402c..365fb01 100644 --- a/svgio/qa/cppunit/SvgImportTest.cxx +++ b/svgio/qa/cppunit/SvgImportTest.cxx @@ -52,6 +52,7 @@ class Test : public test::BootstrapFixture, public XmlTestTools void testTdf97543(); void testRGBColor(); void testRGBAColor(); + void testTdf97936(); Primitive2DSequence parseSvg(const char* aSource); @@ -74,6 +75,7 @@ public: CPPUNIT_TEST(testTdf97543); CPPUNIT_TEST(testRGBColor); CPPUNIT_TEST(testRGBAColor); + CPPUNIT_TEST(testTdf97936); CPPUNIT_TEST_SUITE_END(); }; @@ -350,6 +352,20 @@ void Test::testRGBAColor() assertXPath(pDocument, "/primitive2D/transform/unifiedtransparence", "transparence", "0"); } +void Test::testTdf97936() +{ + // check that both rectangles are rendered in the viewBox + Primitive2DSequence aSequenceTdf97936 = parseSvg("/svgio/qa/cppunit/data/tdf97936.svg"); + CPPUNIT_ASSERT_EQUAL(1, (int)aSequenceTdf97936.getLength()); + + Primitive2dXmlDump dumper; + xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceTdf97936)); + + CPPUNIT_ASSERT (pDocument); + + assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor[1]"); + assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor[2]"); +} CPPUNIT_TEST_SUITE_REGISTRATION(Test); } diff --git a/svgio/qa/cppunit/data/tdf97936.svg b/svgio/qa/cppunit/data/tdf97936.svg new file mode 100644 index 0000000..6c059ec --- /dev/null +++ b/svgio/qa/cppunit/data/tdf97936.svg @@ -0,0 +1,5 @@ +<svg xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink"> +<rect x="70" y="50" height="50" width="50" style="fill: #ccccff"></rect> +<rect x="10" y="50" height="50" width="50" style="fill: #ccccff"></rect> +</svg>
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits