summaryrefslogtreecommitdiff
path: root/svgio/qa
diff options
context:
space:
mode:
authorXisco Fauli <anistenis@gmail.com>2016-02-07 20:01:33 +0100
committerjan iversen <jani@documentfoundation.org>2016-02-09 12:02:16 +0000
commit1dad3e2a1277e6602142e97096b1f6b9965bb0f5 (patch)
tree516630c4e02b346b489de44e2fa1bb5da7934bc3 /svgio/qa
parent0dba1425d2bd0446ec7e54189d8068455ece91c3 (diff)
SVGIO: tdf#45771: Add import test
Change-Id: Ib1b66a3d91374bcf458bb368483f33cd4b8e0f0d Reviewed-on: https://gerrit.libreoffice.org/22189 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: jan iversen <jani@documentfoundation.org> Tested-by: jan iversen <jani@documentfoundation.org>
Diffstat (limited to 'svgio/qa')
-rw-r--r--svgio/qa/cppunit/SvgImportTest.cxx14
-rw-r--r--svgio/qa/cppunit/data/tdf45771.svg5
2 files changed, 19 insertions, 0 deletions
diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx
index e50d8862d0d8..cc4c2679a4f7 100644
--- a/svgio/qa/cppunit/SvgImportTest.cxx
+++ b/svgio/qa/cppunit/SvgImportTest.cxx
@@ -42,6 +42,7 @@ class Test : public test::BootstrapFixture, public XmlTestTools
void testTdf87309();
void testFontsizeKeywords();
void testFontsizePercentage();
+ void testTdf45771();
Primitive2DSequence parseSvg(const char* aSource);
@@ -54,6 +55,7 @@ public:
CPPUNIT_TEST(testTdf87309);
CPPUNIT_TEST(testFontsizeKeywords);
CPPUNIT_TEST(testFontsizePercentage);
+ CPPUNIT_TEST(testTdf45771);
CPPUNIT_TEST_SUITE_END();
};
@@ -190,6 +192,18 @@ void Test::testFontsizePercentage()
assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "height", "16");
}
+void Test::testTdf45771()
+{
+ Primitive2DSequence aSequenceTdf45771 = parseSvg("/svgio/qa/cppunit/data/tdf45771.svg");
+ CPPUNIT_ASSERT_EQUAL(1, (int)aSequenceTdf45771.getLength());
+
+ Primitive2dXmlDump dumper;
+ xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceTdf45771));
+
+ CPPUNIT_ASSERT (pDocument);
+
+ assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "height", "32");
+}
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
}
diff --git a/svgio/qa/cppunit/data/tdf45771.svg b/svgio/qa/cppunit/data/tdf45771.svg
new file mode 100644
index 000000000000..f49e0f569134
--- /dev/null
+++ b/svgio/qa/cppunit/data/tdf45771.svg
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg height="600" width="400" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+
+<text x="5" y="100" font-size="2em">Sample</text>
+</svg>