tdf#97936: SVGIO: Add unittest
Change-Id: I7adb55dc408811f03365578f815bf1b7fbe7f2fd Reviewed-on: https://gerrit.libreoffice.org/22679 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Xisco Faulí <anistenis@gmail.com>
This commit is contained in:
@@ -52,6 +52,7 @@ class Test : public test::BootstrapFixture, public XmlTestTools
|
|||||||
void testTdf97543();
|
void testTdf97543();
|
||||||
void testRGBColor();
|
void testRGBColor();
|
||||||
void testRGBAColor();
|
void testRGBAColor();
|
||||||
|
void testTdf97936();
|
||||||
|
|
||||||
Primitive2DSequence parseSvg(const char* aSource);
|
Primitive2DSequence parseSvg(const char* aSource);
|
||||||
|
|
||||||
@@ -74,6 +75,7 @@ public:
|
|||||||
CPPUNIT_TEST(testTdf97543);
|
CPPUNIT_TEST(testTdf97543);
|
||||||
CPPUNIT_TEST(testRGBColor);
|
CPPUNIT_TEST(testRGBColor);
|
||||||
CPPUNIT_TEST(testRGBAColor);
|
CPPUNIT_TEST(testRGBAColor);
|
||||||
|
CPPUNIT_TEST(testTdf97936);
|
||||||
CPPUNIT_TEST_SUITE_END();
|
CPPUNIT_TEST_SUITE_END();
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -350,6 +352,20 @@ void Test::testRGBAColor()
|
|||||||
assertXPath(pDocument, "/primitive2D/transform/unifiedtransparence", "transparence", "0");
|
assertXPath(pDocument, "/primitive2D/transform/unifiedtransparence", "transparence", "0");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Test::testTdf97936()
|
||||||
|
{
|
||||||
|
// check that both rectangles are rendered in the viewBox
|
||||||
|
Primitive2DSequence aSequenceTdf97936 = parseSvg("/svgio/qa/cppunit/data/tdf97936.svg");
|
||||||
|
CPPUNIT_ASSERT_EQUAL(1, (int)aSequenceTdf97936.getLength());
|
||||||
|
|
||||||
|
Primitive2dXmlDump dumper;
|
||||||
|
xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequenceTdf97936));
|
||||||
|
|
||||||
|
CPPUNIT_ASSERT (pDocument);
|
||||||
|
|
||||||
|
assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor[1]");
|
||||||
|
assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor[2]");
|
||||||
|
}
|
||||||
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
|
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
5
svgio/qa/cppunit/data/tdf97936.svg
Normal file
5
svgio/qa/cppunit/data/tdf97936.svg
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<rect x="70" y="50" height="50" width="50" style="fill: #ccccff"></rect>
|
||||||
|
<rect x="10" y="50" height="50" width="50" style="fill: #ccccff"></rect>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 241 B |
Reference in New Issue
Block a user