[Libreoffice-commits] core.git: svgio/qa

Tomaž Vajngerl tomaz.vajngerl at collabora.com
Sat Aug 2 13:35:27 PDT 2014


 svgio/qa/cppunit/SvgImportTest.cxx              |    8 ++++-
 svgio/qa/cppunit/data/RectWithStylesByGroup.svg |   34 ++++++++++++------------
 2 files changed, 23 insertions(+), 19 deletions(-)

New commits:
commit ba91106b9500d895aee1c60a68a24c752155611d
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date:   Sat Aug 2 22:35:01 2014 +0200

    Change RectWithStylesByGroup to be same as other style tests
    
    Change-Id: Ib7b0d2e8160a938821940645ea6e6471188bcc16

diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx
index 86784a5..5b8392d 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 6fefdf2..0a3b1e3 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>


More information about the Libreoffice-commits mailing list