From 8fbbb923ea752e3c5b147824f0dc04e4b9e27dad Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Sun, 7 Feb 2016 20:27:05 +0100 Subject: SVGIO: tdf#85770: Add import test Change-Id: Ifffe1d461ae6fa30a9cc61df2ece5716078031ab Reviewed-on: https://gerrit.libreoffice.org/22190 Tested-by: Jenkins Reviewed-by: jan iversen Tested-by: jan iversen --- svgio/qa/cppunit/SvgImportTest.cxx | 17 +++++++++++++++++ svgio/qa/cppunit/data/tdf85770.svg | 7 +++++++ 2 files changed, 24 insertions(+) create mode 100644 svgio/qa/cppunit/data/tdf85770.svg (limited to 'svgio/qa') diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx index cc4c2679a4f7..f918a1527946 100644 --- a/svgio/qa/cppunit/SvgImportTest.cxx +++ b/svgio/qa/cppunit/SvgImportTest.cxx @@ -43,6 +43,7 @@ class Test : public test::BootstrapFixture, public XmlTestTools void testFontsizeKeywords(); void testFontsizePercentage(); void testTdf45771(); + void testTdf85770(); Primitive2DSequence parseSvg(const char* aSource); @@ -56,6 +57,7 @@ public: CPPUNIT_TEST(testFontsizeKeywords); CPPUNIT_TEST(testFontsizePercentage); CPPUNIT_TEST(testTdf45771); + CPPUNIT_TEST(testTdf85770); CPPUNIT_TEST_SUITE_END(); }; @@ -204,6 +206,21 @@ void Test::testTdf45771() assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "height", "32"); } + +void Test::testTdf85770() +{ + Primitive2DSequence aSequenceTdf85770 = parseSvg("/svgio/qa/cppunit/data/tdf85770.svg"); + CPPUNIT_ASSERT_EQUAL(1, (int)aSequenceTdf85770.getLength()); + + Primitive2dXmlDump dumper; + xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer(aSequenceTdf85770)); + + CPPUNIT_ASSERT (pDocument); + + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "text", "Start Middle End"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[2]", "text", "Start "); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[3]", "text", "End"); +} CPPUNIT_TEST_SUITE_REGISTRATION(Test); } diff --git a/svgio/qa/cppunit/data/tdf85770.svg b/svgio/qa/cppunit/data/tdf85770.svg new file mode 100644 index 000000000000..b1cf9eb3c26e --- /dev/null +++ b/svgio/qa/cppunit/data/tdf85770.svg @@ -0,0 +1,7 @@ + +Start Middle End +Start Middle End + -- cgit v1.2.3