From 9bf1dac4be55f8591d5fd2b8aa93c9369191c02c Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Mon, 30 May 2016 22:20:51 +0200 Subject: tdf#99994: Add unittest MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I1a58dc21fdcdf8e7688508105fbd6438c7f4bda0 Reviewed-on: https://gerrit.libreoffice.org/25690 Tested-by: Jenkins Reviewed-by: Xisco FaulĂ­ --- svgio/qa/cppunit/SvgImportTest.cxx | 19 +++++++++++++++++++ svgio/qa/cppunit/data/tdf99994.svg | 8 ++++++++ 2 files changed, 27 insertions(+) create mode 100644 svgio/qa/cppunit/data/tdf99994.svg (limited to 'svgio/qa') diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx index 645ad1b0cbef..50bd744abc45 100644 --- a/svgio/qa/cppunit/SvgImportTest.cxx +++ b/svgio/qa/cppunit/SvgImportTest.cxx @@ -60,6 +60,7 @@ class Test : public test::BootstrapFixture, public XmlTestTools void test47446(); void test47446b(); void testMaskText(); + void testTdf99994(); Primitive2DSequence parseSvg(const char* aSource); @@ -90,6 +91,7 @@ public: CPPUNIT_TEST(test47446); CPPUNIT_TEST(test47446b); CPPUNIT_TEST(testMaskText); + CPPUNIT_TEST(testTdf99994); CPPUNIT_TEST_SUITE_END(); }; @@ -607,6 +609,23 @@ void Test::testMaskText() assertXPath(pDocument, "/primitive2D/transform/transform/textsimpleportion", "familyname", "Times New Roman"); } +void Test::testTdf99994() +{ + //Check text fontsize when using relative units + Primitive2DSequence aSequenceTdf99994 = parseSvg("/svgio/qa/cppunit/data/tdf99994.svg"); + CPPUNIT_ASSERT_EQUAL(1, (int)aSequenceTdf99994.getLength()); + + Primitive2dXmlDump dumper; + xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer(aSequenceTdf99994)); + + CPPUNIT_ASSERT (pDocument); + + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "fontcolor", "#0000ff"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "height", "16"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "text", "test"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "familyname", "Sans"); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); } diff --git a/svgio/qa/cppunit/data/tdf99994.svg b/svgio/qa/cppunit/data/tdf99994.svg new file mode 100644 index 000000000000..b4dec353e159 --- /dev/null +++ b/svgio/qa/cppunit/data/tdf99994.svg @@ -0,0 +1,8 @@ + + + + test + + -- cgit