[Libreoffice-commits] core.git: svgio/qa

Xisco Fauli anistenis at gmail.com
Tue Apr 12 22:01:12 UTC 2016


 svgio/qa/cppunit/SvgImportTest.cxx |   34 ++++++++++++++++++++++++++++++++++
 svgio/qa/cppunit/data/47446.svg    |   19 +++++++++++++++++++
 svgio/qa/cppunit/data/47446b.svg   |   18 ++++++++++++++++++
 3 files changed, 71 insertions(+)

New commits:
commit de32fe50299a8891102528379e291919d2b66f56
Author: Xisco Fauli <anistenis at gmail.com>
Date:   Tue Apr 12 08:00:51 2016 +0200

    SVG: Add unittest for tdf#47446 and tdf#98599
    
    Change-Id: I86bec5694eb0c85596d2573111ddb355bd3ae09e
    Reviewed-on: https://gerrit.libreoffice.org/24011
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Xisco FaulĂ­ <anistenis at gmail.com>

diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx
index 4980a31..6ae57af 100644
--- a/svgio/qa/cppunit/SvgImportTest.cxx
+++ b/svgio/qa/cppunit/SvgImportTest.cxx
@@ -57,6 +57,8 @@ class Test : public test::BootstrapFixture, public XmlTestTools
     void testClipPathAndStyle();
     void testi125329();
     void testMaskingPath07b();
+    void test47446();
+    void test47446b();
 
     Primitive2DSequence parseSvg(const char* aSource);
 
@@ -84,6 +86,8 @@ public:
     CPPUNIT_TEST(testClipPathAndStyle);
     CPPUNIT_TEST(testi125329);
     CPPUNIT_TEST(testMaskingPath07b);
+    CPPUNIT_TEST(test47446);
+    CPPUNIT_TEST(test47446b);
     CPPUNIT_TEST_SUITE_END();
 };
 
@@ -484,6 +488,36 @@ void Test::testMaskingPath07b()
 
 }
 
+void Test::test47446()
+{
+    //Check that marker's fill attribute is black is not set
+    Primitive2DSequence aSequence47446 = parseSvg("/svgio/qa/cppunit/data/47446.svg");
+    CPPUNIT_ASSERT_EQUAL(1, (int)aSequence47446.getLength());
+
+    Primitive2dXmlDump dumper;
+    xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequence47446));
+
+    CPPUNIT_ASSERT (pDocument);
+
+    assertXPath(pDocument, "/primitive2D/transform/transform/transform/polypolygoncolor", "color", "#000000");
+
+}
+
+void Test::test47446b()
+{
+    //Check that marker's fill attribute is inherit from def
+    Primitive2DSequence aSequence47446b = parseSvg("/svgio/qa/cppunit/data/47446b.svg");
+    CPPUNIT_ASSERT_EQUAL(1, (int)aSequence47446b.getLength());
+
+    Primitive2dXmlDump dumper;
+    xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequence47446b));
+
+    CPPUNIT_ASSERT (pDocument);
+
+    assertXPath(pDocument, "/primitive2D/transform/transform/transform/polypolygoncolor", "color", "#ffff00");
+
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
 
 }
diff --git a/svgio/qa/cppunit/data/47446.svg b/svgio/qa/cppunit/data/47446.svg
new file mode 100644
index 0000000..aec66b9
--- /dev/null
+++ b/svgio/qa/cppunit/data/47446.svg
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8" standalone="no" ?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" 
+  "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg width="12cm" height="4cm" viewBox="0 0 1200 400"
+     xmlns="http://www.w3.org/2000/svg" version="1.1">
+<defs>
+    <marker id="Triangle"
+      markerUnits="strokeWidth" refY="3"
+      markerWidth="6" markerHeight="6"
+      orient="auto">
+      <path d="M 0 0 L 6 3 L 0 6 z"
+            stroke-width="0.5" stroke="black"/>
+    </marker>   
+</defs>
+           
+<polyline fill="none" stroke="red" stroke-width="10" 
+            points="450,50 550,50 650,150"
+      marker-end="url(#Triangle)" />
+</svg>
diff --git a/svgio/qa/cppunit/data/47446b.svg b/svgio/qa/cppunit/data/47446b.svg
new file mode 100644
index 0000000..29cfce5
--- /dev/null
+++ b/svgio/qa/cppunit/data/47446b.svg
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8" standalone="no" ?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" 
+  "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg width="12cm" height="4cm" viewBox="0 0 1200 400"
+     xmlns="http://www.w3.org/2000/svg" version="1.1">
+<defs fill="yellow">
+    <marker id="Triangle"
+      markerUnits="strokeWidth" refY="3"
+      markerWidth="6" markerHeight="6"
+      orient="auto">
+      <path d="M 0 0 L 6 3 L 0 6 z"
+            stroke-width="0.5" stroke="black"/>
+    </marker>   
+</defs>          
+<polyline fill="none" stroke="red" stroke-width="10" 
+            points="450,50 550,50 650,150"
+      marker-end="url(#Triangle)" />
+</svg>


More information about the Libreoffice-commits mailing list