vhardy      2003/06/30 08:04:44

  Modified:    test-resources/org/apache/batik/dom unitTesting.xml
               sources/org/apache/batik/dom/svg AbstractSVGPathSegList.java
  Added:       test-resources/org/apache/batik/dom bug20331.svg
  Log:
  Fixed bug 20331. Added new test to the test suite
  
  Revision  Changes    Path
  1.12      +2 -1      xml-batik/test-resources/org/apache/batik/dom/unitTesting.xml
  
  Index: unitTesting.xml
  ===================================================================
  RCS file: /home/cvs/xml-batik/test-resources/org/apache/batik/dom/unitTesting.xml,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- unitTesting.xml   30 Jun 2003 12:36:44 -0000      1.11
  +++ unitTesting.xml   30 Jun 2003 15:04:44 -0000      1.12
  @@ -19,6 +19,7 @@
       <testGroup id="ecmaDOM" name="Basic DOM Tests from ECMA Scripts"
                  class="org.apache.batik.dom.EcmaScriptDOMTest">
           <test id="bug18143" />
  +        <test id="bug20331" />
       </testGroup>
   
       <!-- ========================================================================== 
-->
  
  
  
  1.1                  xml-batik/test-resources/org/apache/batik/dom/bug20331.svg
  
  Index: bug20331.svg
  ===================================================================
  <?xml version="1.0" standalone="no"?>
  <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
  "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd";>
  
  
  <!-- ========================================================================= -->
  <!-- Copyright (C) The Apache Software Foundation. All rights reserved.        -->
  <!--                                                                           -->
  <!-- This software is published under the terms of the Apache Software License -->
  <!-- version 1.1, a copy of which has been included with this distribution in  -->
  <!-- the LICENSE file.                                                         -->
  <!-- ========================================================================= -->
  
  <!-- ========================================================================= -->
  <!--                                                                           -->
  <!-- @author [EMAIL PROTECTED]                                             -->
  <!-- @version $Id: bug20331.svg,v 1.1 2003/06/30 15:04:44 vhardy Exp $          -->
  <!-- ========================================================================= -->
  
  <svg xmlns="http://www.w3.org/2000/svg"; 
       xmlns:xlink="http://www.w3.org/1999/xlink"; 
       xmlns:test="http://xml.apache.org/batik/test";
       width="350" height="350" onload="runTest(evt)" >
  
      <test:testResult id="testResult" result="failed" code="invalid.path.seg.value"/>
  
      <script type="text/ecmascript"><![CDATA[
     var testNS = "http://xml.apache.org/batik/test";;
     var svgNS = "http://www.w3.org/2000/svg";;
  
     function runTest() {
         var result = document.getElementById("testResult");
         var path = document.createElementNS(svgNS, "path");
         var svgPathSegArcRel = path.createSVGPathSegArcRel(1, 2, 3, 4, 5, false, 
false);
         if (svgPathSegArcRel.getR1() != 3 
             || svgPathSegArcRel.getR2() != 4) {
            return;
         } 
  
         var svgPathSegArcAbs = path.createSVGPathSegArcAbs(1,2,3,4,5,false,false);
         if (svgPathSegArcAbs.getR1() != 3 
             || svgPathSegArcAbs.getR2() != 4) {
            return;
         }
      
         var p = document.getElementById("path");
         if (p == null) {
             return;
         }
  
         var psl = p.pathSegList;
  
         if (psl == null) {
            return;
         }
  
         if (psl.numberOfItems != 3) {
             result.setAttributeNS(null, "code", "wrong.number.of.path.seg");
             return;
         }
  
         var ps = psl.getItem(0);
         if (ps == null || ps.pathSegType != 2) {
             result.setAttributeNS(null, "code", "wrong.first.seg.type.0.M.vs." + 
ps.pathSegType);
             return;
         }
  
         ps = psl.getItem(1);
         if (ps == null || ps.pathSegType != 10) {
             result.setAttributeNS(null, "code", "wrong.first.seg.type.1.A.vs." + 
ps.pathSegType);
             return;
         }
  
         if (ps.r1 != 2 || ps.r2 != 3) {
             result.setAttributeNS(null, "code", "wrong.r1.2.vs." + ps.r1 + " or 
r2.3.vs." + ps.r2);
             return;
         }
  
         ps = psl.getItem(2);
         if (ps == null || ps.pathSegType != 1) {
             result.setAttributeNS(null, "code", "wrong.first.seg.type.2.Z.vs." + 
ps.pathSegType);
             return;
         }
  
         var t = document.getElementById("text"); 
         t.setAttributeNS(null, "fill", "#0F0");
         result.setAttributeNS(null, "result", "passed");
     }
  
  ]]></script>
  
      <text id="text" x="50%" y="50%" text-anchor="middle" fill="red">This string is 
red if test failed, green otherwise</text>
      <path d="M 0 0 A 2 3 0 0 0 4 5 Z" id="path"/>
  </svg>
  
  
  
  1.4       +2 -2      
xml-batik/sources/org/apache/batik/dom/svg/AbstractSVGPathSegList.java
  
  Index: AbstractSVGPathSegList.java
  ===================================================================
  RCS file: 
/home/cvs/xml-batik/sources/org/apache/batik/dom/svg/AbstractSVGPathSegList.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- AbstractSVGPathSegList.java       11 Apr 2003 13:56:08 -0000      1.3
  +++ AbstractSVGPathSegList.java       30 Jun 2003 15:04:44 -0000      1.4
  @@ -533,7 +533,7 @@
                      SVGPathSegArcRel {
   
           public SVGPathSegArcItem(short type,String letter,
  -                             float rx,float ry,float angle,
  +                             float r1,float r2,float angle,
                                boolean largeArcFlag, boolean sweepFlag,
                                float x, float y ){
               super(type,letter);
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to