diff options
author | Xisco Fauli <anistenis@gmail.com> | 2016-02-07 19:36:31 +0100 |
---|---|---|
committer | jan iversen <jani@documentfoundation.org> | 2016-02-09 08:48:49 +0000 |
commit | 17f01039fca2a992f0dfa768fcb640ae26035a88 (patch) | |
tree | 4e89333f5c07a5ace0999e08a4087f83ad97fbbf /svgio | |
parent | ad8d6d9ef53717e072005fe518ba8ded61e96711 (diff) |
SVGIO: Add import test for 7c151f39144b7401a99c7b736a41e5dce4ac4db1
Change-Id: I4ab4463dfa2422fd0d8fa1fd65d7765f716c9bc3
Reviewed-on: https://gerrit.libreoffice.org/22188
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: jan iversen <jani@documentfoundation.org>
Diffstat (limited to 'svgio')
-rw-r--r-- | svgio/qa/cppunit/SvgImportTest.cxx | 16 | ||||
-rw-r--r-- | svgio/qa/cppunit/data/FontsizePercentage.svg | 3 |
2 files changed, 19 insertions, 0 deletions
diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx index be071dd5e85c..e50d8862d0d8 100644 --- a/svgio/qa/cppunit/SvgImportTest.cxx +++ b/svgio/qa/cppunit/SvgImportTest.cxx @@ -41,6 +41,7 @@ class Test : public test::BootstrapFixture, public XmlTestTools void testStyles(); void testTdf87309(); void testFontsizeKeywords(); + void testFontsizePercentage(); Primitive2DSequence parseSvg(const char* aSource); @@ -52,6 +53,7 @@ public: CPPUNIT_TEST(testStyles); CPPUNIT_TEST(testTdf87309); CPPUNIT_TEST(testFontsizeKeywords); + CPPUNIT_TEST(testFontsizePercentage); CPPUNIT_TEST_SUITE_END(); }; @@ -174,6 +176,20 @@ void Test::testFontsizeKeywords() assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[10]", "height", "16"); } + +void Test::testFontsizePercentage() +{ + Primitive2DSequence aSequenceFontsizePercentage = parseSvg("/svgio/qa/cppunit/data/FontsizePercentage.svg"); + CPPUNIT_ASSERT_EQUAL(1, (int)aSequenceFontsizePercentage.getLength()); + + Primitive2dXmlDump dumper; + xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceFontsizePercentage)); + + CPPUNIT_ASSERT (pDocument); + + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "height", "16"); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); } diff --git a/svgio/qa/cppunit/data/FontsizePercentage.svg b/svgio/qa/cppunit/data/FontsizePercentage.svg new file mode 100644 index 000000000000..fc7c9fa61ca8 --- /dev/null +++ b/svgio/qa/cppunit/data/FontsizePercentage.svg @@ -0,0 +1,3 @@ +<?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" font-size="100%"> + <text x="5" y="15">Sample</text> +</svg> |