summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXisco Fauli <anistenis@gmail.com>2016-02-24 23:40:25 +0100
committerXisco FaulĂ­ <anistenis@gmail.com>2016-02-25 08:43:01 +0000
commit6afec8e461aee826664347adf234a81228a69a45 (patch)
tree975284c40ccc9860eb97b00e7377aa808feafda4
parentb914d4a70f4955dc15af3c18b61b0a75e1ed5357 (diff)
tdf#97936: SVGIO: Add unittest
Change-Id: I7adb55dc408811f03365578f815bf1b7fbe7f2fd Reviewed-on: https://gerrit.libreoffice.org/22679 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Xisco FaulĂ­ <anistenis@gmail.com>
-rw-r--r--svgio/qa/cppunit/SvgImportTest.cxx16
-rw-r--r--svgio/qa/cppunit/data/tdf97936.svg5
2 files changed, 21 insertions, 0 deletions
diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx
index 801402cdddb3..365fb013eeb4 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 000000000000..6c059ec5dbef
--- /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>