diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.com> | 2014-08-02 22:35:01 +0200 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.com> | 2014-08-02 22:37:11 +0200 |
commit | ba91106b9500d895aee1c60a68a24c752155611d (patch) | |
tree | b79f7c8a536a44631371f23b6c767b7128a52d5b /svgio | |
parent | scp2: remove unused STD_LIB_FILE etc. macros (diff) | |
download | core-ba91106b9500d895aee1c60a68a24c752155611d.tar.gz core-ba91106b9500d895aee1c60a68a24c752155611d.zip |
Change RectWithStylesByGroup to be same as other style tests
Change-Id: Ib7b0d2e8160a938821940645ea6e6471188bcc16
Diffstat (limited to 'svgio')
-rw-r--r-- | svgio/qa/cppunit/SvgImportTest.cxx | 8 | ||||
-rw-r--r-- | svgio/qa/cppunit/data/RectWithStylesByGroup.svg | 34 |
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> |