summaryrefslogtreecommitdiff
path: root/svgio
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.com>2014-08-02 22:35:01 +0200
committerTomaž Vajngerl <tomaz.vajngerl@collabora.com>2014-08-02 22:37:11 +0200
commitba91106b9500d895aee1c60a68a24c752155611d (patch)
treeb79f7c8a536a44631371f23b6c767b7128a52d5b /svgio
parentee24b3b7d82e8a5d737ec545d0eff227f362483b (diff)
Change RectWithStylesByGroup to be same as other style tests
Change-Id: Ib7b0d2e8160a938821940645ea6e6471188bcc16
Diffstat (limited to 'svgio')
-rw-r--r--svgio/qa/cppunit/SvgImportTest.cxx8
-rw-r--r--svgio/qa/cppunit/data/RectWithStylesByGroup.svg34
2 files changed, 23 insertions, 19 deletions
diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx
index 86784a599581..5b8392d843a8 100644
--- a/svgio/qa/cppunit/SvgImportTest.cxx
+++ b/svgio/qa/cppunit/SvgImportTest.cxx
@@ -72,6 +72,9 @@ void Test::tearDown()
BootstrapFixture::tearDown();
}
+// Attributes for an object (like rect as in this case) can be defined
+// in different ways (directly with xml attributes, or with CSS styles),
+// however the end result should be the same.
void Test::testStyles()
{
Primitive2DSequence maSequenceRect = parseSvg("/svgio/qa/cppunit/data/Rect.svg");
@@ -86,8 +89,9 @@ void Test::testStyles()
Primitive2DSequence maSequenceRectWithStylesByGroup = parseSvg("/svgio/qa/cppunit/data/RectWithStylesByGroup.svg");
CPPUNIT_ASSERT_EQUAL(1, (int) maSequenceRectWithStylesByGroup.getLength());
- CPPUNIT_ASSERT_EQUAL(true, (bool) arePrimitive2DSequencesEqual(maSequenceRect, maSequenceRectWithStyle));
- CPPUNIT_ASSERT_EQUAL(true, (bool) arePrimitive2DSequencesEqual(maSequenceRect, maSequenceRectWithParentStyle));
+ CPPUNIT_ASSERT(arePrimitive2DSequencesEqual(maSequenceRect, maSequenceRectWithStyle));
+ CPPUNIT_ASSERT(arePrimitive2DSequencesEqual(maSequenceRect, maSequenceRectWithParentStyle));
+ CPPUNIT_ASSERT(arePrimitive2DSequencesEqual(maSequenceRect, maSequenceRectWithStylesByGroup));
}
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
diff --git a/svgio/qa/cppunit/data/RectWithStylesByGroup.svg b/svgio/qa/cppunit/data/RectWithStylesByGroup.svg
index 6fefdf2f53f2..0a3b1e3cd8eb 100644
--- a/svgio/qa/cppunit/data/RectWithStylesByGroup.svg
+++ b/svgio/qa/cppunit/data/RectWithStylesByGroup.svg
@@ -1,18 +1,18 @@
-<?xml version="1.0" standalone="no"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
- "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
-<svg xmlns="http://www.w3.org/2000/svg" version="1.1"
- width="10cm" height="5cm" viewBox="0 0 1000 500">
- <defs>
- <style type="text/css"><![CDATA[
- g {
- fill: red;
- stroke: blue;
- stroke-width: 3
- }
- ]]></style>
- </defs>
-<g>
- <rect x="200" y="100" width="600" height="300"/>
-</g>
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<svg width="120" height="120" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <defs>
+ <style type="text/css">
+ <![CDATA[
+ g
+ {
+ stroke: #ff0000;
+ fill: #00cc00;
+ }
+ ]]>
+ </style>
+ </defs>
+ <g>
+ <rect x="10" y="10" width="100" height="100" rx="10" ry="10" style="stroke-width: 3;" />
+ </g>
</svg>