diff options
author | Xisco Fauli <anistenis@gmail.com> | 2016-05-30 22:20:51 +0200 |
---|---|---|
committer | Xisco Faulí <anistenis@gmail.com> | 2016-06-01 12:05:38 +0000 |
commit | 9bf1dac4be55f8591d5fd2b8aa93c9369191c02c (patch) | |
tree | 5e5e8b5a02d9fae1e565ae9c38bed7c5937a2586 /svgio/qa | |
parent | c098b863ee8532a2c74376214fa8d1353a7414f7 (diff) |
tdf#99994: Add unittest
Change-Id: I1a58dc21fdcdf8e7688508105fbd6438c7f4bda0
Reviewed-on: https://gerrit.libreoffice.org/25690
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Xisco Faulí <anistenis@gmail.com>
Diffstat (limited to 'svgio/qa')
-rw-r--r-- | svgio/qa/cppunit/SvgImportTest.cxx | 19 | ||||
-rw-r--r-- | svgio/qa/cppunit/data/tdf99994.svg | 8 |
2 files changed, 27 insertions, 0 deletions
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<Primitive2DContainer>(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 @@ +<svg xmlns="http://www.w3.org/2000/svg"> +<style type="text/css" id="style1"> +*{fill:blue;} +</style> +<text id="text1" style="font-family:Sans;"> + <tspan id="tspan1">test</tspan> +</text> +</svg> |