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>
This commit is contained in:
Xisco Fauli 2016-05-30 22:20:51 +02:00 committed by Xisco Faulí
parent c098b863ee
commit 9bf1dac4be
2 changed files with 27 additions and 0 deletions

View File

@ -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);
}

View File

@ -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>

After

Width:  |  Height:  |  Size: 192 B