From 805b328858e2d1414e7a9e7701c42a41ede2a617 Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Sun, 7 Feb 2016 19:25:20 +0100 Subject: SVGIO: Add import test for Fontsize keywords MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I042a1deeec1c07f73f09ddd2fb71b9d2eba6b8c6 Reviewed-on: https://gerrit.libreoffice.org/22187 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl Reviewed-by: jan iversen --- svgio/qa/cppunit/SvgImportTest.cxx | 24 ++++++++++++++++++++++++ svgio/qa/cppunit/data/FontsizeKeywords.svg | 14 ++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 svgio/qa/cppunit/data/FontsizeKeywords.svg (limited to 'svgio/qa') diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx index d065e0f34f1c..be071dd5e85c 100644 --- a/svgio/qa/cppunit/SvgImportTest.cxx +++ b/svgio/qa/cppunit/SvgImportTest.cxx @@ -40,6 +40,7 @@ class Test : public test::BootstrapFixture, public XmlTestTools void testStyles(); void testTdf87309(); + void testFontsizeKeywords(); Primitive2DSequence parseSvg(const char* aSource); @@ -50,6 +51,7 @@ public: CPPUNIT_TEST_SUITE(Test); CPPUNIT_TEST(testStyles); CPPUNIT_TEST(testTdf87309); + CPPUNIT_TEST(testFontsizeKeywords); CPPUNIT_TEST_SUITE_END(); }; @@ -150,6 +152,28 @@ void Test::testTdf87309() assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "color", "#000000"); } +void Test::testFontsizeKeywords() +{ + Primitive2DSequence aSequenceFontsizeKeywords = parseSvg("/svgio/qa/cppunit/data/FontsizeKeywords.svg"); + CPPUNIT_ASSERT_EQUAL(1, (int)aSequenceFontsizeKeywords.getLength()); + + Primitive2dXmlDump dumper; + xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer(aSequenceFontsizeKeywords)); + + CPPUNIT_ASSERT (pDocument); + + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "height", "9"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[2]", "height", "11"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[3]", "height", "13"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[4]", "height", "16"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[5]", "height", "19"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[6]", "height", "23"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[7]", "height", "27"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[8]", "height", "13"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[9]", "height", "19"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[10]", "height", "16"); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); } diff --git a/svgio/qa/cppunit/data/FontsizeKeywords.svg b/svgio/qa/cppunit/data/FontsizeKeywords.svg new file mode 100644 index 000000000000..c0a5caebdb80 --- /dev/null +++ b/svgio/qa/cppunit/data/FontsizeKeywords.svg @@ -0,0 +1,14 @@ + + + +Sample +Sample +Sample +Sample +Sample +Sample +Sample +Sample +Sample +Sample + -- cgit