[Libreoffice-commits] .: 5 commits - chart2/qa chart2/source sc/Module_sc.mk sc/qa svl/inc test/inc test/source

Markus Mohrhard mmohrhard at kemper.freedesktop.org
Thu Apr 26 18:15:02 PDT 2012


 chart2/qa/unit/data/reference/testChart.xml |  120 ++++++++++++++--------------
 chart2/source/view/main/ChartView.cxx       |    6 -
 sc/Module_sc.mk                             |    1 
 sc/qa/extras/regression-test.cxx            |   35 +-------
 svl/inc/svl/style.hxx                       |    2 
 test/inc/test/xmldiff.hxx                   |    6 +
 test/source/diff/diff.cxx                   |   30 +++++--
 7 files changed, 101 insertions(+), 99 deletions(-)

New commits:
commit 811899e4a28f8b37c23c07fc524dbf1f3c1b6fb5
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Fri Apr 27 02:59:16 2012 +0200

    improve assert messages

diff --git a/test/source/diff/diff.cxx b/test/source/diff/diff.cxx
index 6b97f29..4d13023 100644
--- a/test/source/diff/diff.cxx
+++ b/test/source/diff/diff.cxx
@@ -31,6 +31,7 @@
 #include <libxml/xpath.h>
 #include <rtl/math.hxx>
 #include <cstring>
+#include <sstream>
 #include <cmath>
 #include <cassert>
 
@@ -94,7 +95,7 @@ void XMLDiff::loadToleranceFile(xmlDocPtr xmlToleranceFile)
 {
     xmlNodePtr root = xmlDocGetRootElement(xmlToleranceFile);
 #if USE_CPPUNIT
-    CPPUNIT_ASSERT_MESSAGE("did not find tolerance file", xmlStrEqual( root->name, BAD_CAST("tolerances") ));
+    CPPUNIT_ASSERT_MESSAGE("did not find correct tolerance file", xmlStrEqual( root->name, BAD_CAST("tolerances") ));
 #else
     if(!xmlStrEqual( root->name, BAD_CAST("tolerances") ))
     {
@@ -125,7 +126,9 @@ bool XMLDiff::compare()
 #if USE_CPPUNIT
     CPPUNIT_ASSERT(root1);
     CPPUNIT_ASSERT(root2);
-    CPPUNIT_ASSERT(xmlStrEqual(root1->name, root2->name));
+    std::stringstream stringStream("Expected: ");
+    stringStream << (char*)root1->name << "\nFound: " << (char*) root2->name;
+    CPPUNIT_ASSERT(stringStream.str(), xmlStrEqual(root1->name, root2->name));
 #else
     if (!root1 || !root2)
         return false;
@@ -155,7 +158,9 @@ bool checkForEmptyChildren(xmlNodePtr node)
 bool XMLDiff::compareElements(xmlNode* node1, xmlNode* node2)
 {
 #if USE_CPPUNIT
-    CPPUNIT_ASSERT(xmlStrEqual( node1->name, node2->name ));
+    std::stringstream stringStream("Expected: ");
+    stringStream << (xmlChar*) node1->name << "\nFound: " << node2->name;
+    CPPUNIT_ASSERT_MESSAGE(stringStream.str(), xmlStrEqual( node1->name, node2->name ));
 #else
     if (!xmlStrEqual( node1->name, node2->name ))
         return false;
@@ -248,7 +253,10 @@ bool XMLDiff::compareAttributes(xmlNodePtr node1, xmlNodePtr node2)
             {
                 bool valInTolerance = compareValuesWithTolerance(dVal1, dVal2, itr->value, itr->relative);
 #if USE_CPPUNIT
-                CPPUNIT_ASSERT(valInTolerance);
+                std::stringstream stringStream("Expected Value: ");
+                stringStream << dVal1 << "; Found Value: " << dVal2 << "; Tolerance: " << itr->value;
+                stringStream << "; Relative: " << itr->relative;
+                CPPUNIT_ASSERT_MESSAGE(stringStream.str(), valInTolerance);
 #else
                 if (!valInTolerance)
                     return false;
@@ -268,10 +276,12 @@ bool XMLDiff::compareAttributes(xmlNodePtr node1, xmlNodePtr node2)
         {
 
 #if USE_CPPUNIT
-        CPPUNIT_ASSERT(xmlStrEqual(val1, val2));
+            std::stringstream stringStream("Expected: ");
+            stringStream << (char*)val1 << "\nFound: " << (char*)val2;
+            CPPUNIT_ASSERT_MESSAGE(stringStream.str(), xmlStrEqual(val1, val2));
 #else
-        if(!xmlStrEqual( val1, val2 ))
-            return false;
+            if(!xmlStrEqual( val1, val2 ))
+                return false;
 #endif
         }
 
commit e776953fc360ba161e5ac398bcb707962fb741fe
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Fri Apr 27 02:21:28 2012 +0200

    enable chart regression test

diff --git a/sc/Module_sc.mk b/sc/Module_sc.mk
index b6a42e1..18ab358 100644
--- a/sc/Module_sc.mk
+++ b/sc/Module_sc.mk
@@ -53,6 +53,7 @@ $(eval $(call gb_Module_add_slowcheck_targets,sc,\
 $(eval $(call gb_Module_add_subsequentcheck_targets,sc,\
     JunitTest_sc_complex \
     JunitTest_sc_unoapi \
+    CppunitTest_sc_chart_regression_test \
     CppunitTest_sc_cellrangeobj \
     $(if $(filter-out $(OS),IOS), \
 	    CppunitTest_sc_databaserangeobj) \
commit 8a7a891a9fd8030559b4ef86cd7ca9b335b2aa53
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Fri Apr 27 02:19:58 2012 +0200

    adapt dumper to new xml diff

diff --git a/chart2/qa/unit/data/reference/testChart.xml b/chart2/qa/unit/data/reference/testChart.xml
index b2e4aea..c8eae26 100644
--- a/chart2/qa/unit/data/reference/testChart.xml
+++ b/chart2/qa/unit/data/reference/testChart.xml
@@ -1,65 +1,65 @@
 <?xml version="1.0"?>
 <XShapes>
- <XShape position="0,0" size="16000x9000" type="com.sun.star.drawing.RectangleShape" name="CID/Page="/>
- <XShape position="770,854" size="13068x7546" type="com.sun.star.drawing.GroupShape" name="CID/D=0">
+ <XShape positionX="0" positionY="0" sizeX="16000" sizeY="9000" type="com.sun.star.drawing.RectangleShape" name="CID/Page="/>
+ <XShape positionX="770" positionY="854" sizeX="13068" sizeY="7546" type="com.sun.star.drawing.GroupShape" name="CID/D=0">
   <XShapes>
-   <XShape position="1206,1054" size="12632x6699" type="com.sun.star.drawing.RectangleShape" name="MarkHandles"/>
-   <XShape position="770,855" size="13068x7545" type="com.sun.star.drawing.RectangleShape" name="PlotAreaIncludingAxes"/>
-   <XShape position="770,854" size="13068x7546" type="com.sun.star.drawing.GroupShape">
+   <XShape positionX="1206" positionY="1054" sizeX="12632" sizeY="6699" type="com.sun.star.drawing.RectangleShape" name="MarkHandles"/>
+   <XShape positionX="770" positionY="855" sizeX="13068" sizeY="7545" type="com.sun.star.drawing.RectangleShape" name="PlotAreaIncludingAxes"/>
+   <XShape positionX="770" positionY="854" sizeX="13068" sizeY="7546" type="com.sun.star.drawing.GroupShape">
     <XShapes>
-     <XShape position="1056,1052" size="12782x6850" type="com.sun.star.drawing.GroupShape">
+     <XShape positionX="1056" positionY="1052" sizeX="12782" sizeY="6850" type="com.sun.star.drawing.GroupShape">
       <XShapes>
-       <XShape position="1206,1054" size="12632x6699" type="com.sun.star.drawing.GroupShape" name="PlotAreaExcludingAxes">
+       <XShape positionX="1206" positionY="1054" sizeX="12632" sizeY="6699" type="com.sun.star.drawing.GroupShape" name="PlotAreaExcludingAxes">
         <XShapes>
-         <XShape position="1206,1054" size="12632x6699" type="com.sun.star.drawing.RectangleShape" name="CID/DiagramWall="/>
+         <XShape positionX="1206" positionY="1054" sizeX="12632" sizeY="6699" type="com.sun.star.drawing.RectangleShape" name="CID/DiagramWall="/>
         </XShapes>
        </XShape>
-       <XShape position="1056,1052" size="12782x6850" type="com.sun.star.drawing.GroupShape" name="testonly;CooContainer=XXX_CID">
+       <XShape positionX="1056" positionY="1052" sizeX="12782" sizeY="6850" type="com.sun.star.drawing.GroupShape" name="testonly;CooContainer=XXX_CID">
         <XShapes>
-         <XShape position="1206,1052" size="12632x6700" type="com.sun.star.drawing.GroupShape">
+         <XShape positionX="1206" positionY="1052" sizeX="12632" sizeY="6700" type="com.sun.star.drawing.GroupShape">
           <XShapes>
-           <XShape position="1206,1052" size="12632x6700" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=1,0:Grid=0">
+           <XShape positionX="1206" positionY="1052" sizeX="12632" sizeY="6700" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=1,0:Grid=0">
             <XShapes>
-             <XShape position="1206,1052" size="12632x6700" type="com.sun.star.drawing.PolyLineShape"/>
-             <XShape position="1206,1052" size="0x6700" type="com.sun.star.drawing.PolyLineShape" name="HandlesOnly"/>
+             <XShape positionX="1206" positionY="1052" sizeX="12632" sizeY="6700" type="com.sun.star.drawing.PolyLineShape"/>
+             <XShape positionX="1206" positionY="1052" sizeX="0" sizeY="6700" type="com.sun.star.drawing.PolyLineShape" name="HandlesOnly"/>
             </XShapes>
            </XShape>
           </XShapes>
          </XShape>
-         <XShape position="1056,1052" size="12782x6850" type="com.sun.star.drawing.GroupShape">
+         <XShape positionX="1056" positionY="1052" sizeX="12782" sizeY="6850" type="com.sun.star.drawing.GroupShape">
           <XShapes>
-           <XShape position="1206,7752" size="12632x150" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=0,0">
+           <XShape positionX="1206" positionY="7752" sizeX="12632" sizeY="150" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=0,0">
             <XShapes>
-             <XShape position="1206,7752" size="12632x150" type="com.sun.star.drawing.PolyLineShape"/>
-             <XShape position="1206,7752" size="12632x0" type="com.sun.star.drawing.LineShape" name="MarkHandles"/>
+             <XShape positionX="1206" positionY="7752" sizeX="12632" sizeY="150" type="com.sun.star.drawing.PolyLineShape"/>
+             <XShape positionX="1206" positionY="7752" sizeX="12632" sizeY="0" type="com.sun.star.drawing.LineShape" name="MarkHandles"/>
             </XShapes>
            </XShape>
-           <XShape position="1056,1052" size="150x6700" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=1,0">
+           <XShape positionX="1056" positionY="1052" sizeX="150" sizeY="6700" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=1,0">
             <XShapes>
-             <XShape position="1056,1052" size="150x6700" type="com.sun.star.drawing.PolyLineShape"/>
-             <XShape position="1206,1052" size="0x6700" type="com.sun.star.drawing.LineShape" name="MarkHandles"/>
+             <XShape positionX="1056" positionY="1052" sizeX="150" sizeY="6700" type="com.sun.star.drawing.PolyLineShape"/>
+             <XShape positionX="1206" positionY="1052" sizeX="0" sizeY="6700" type="com.sun.star.drawing.LineShape" name="MarkHandles"/>
             </XShapes>
            </XShape>
           </XShapes>
          </XShape>
-         <XShape position="1627,2169" size="11789x5583" type="com.sun.star.drawing.GroupShape">
+         <XShape positionX="1627" positionY="2169" sizeX="11789" sizeY="5583" type="com.sun.star.drawing.GroupShape">
           <XShapes>
-           <XShape position="1627,2169" size="10947x5583" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:CT=0:Series=0">
+           <XShape positionX="1627" positionY="2169" sizeX="10947" sizeY="5583" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:CT=0:Series=0">
             <XShapes>
-             <XShape position="11732,2169" size="842x5583" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=4"/>
-             <XShape position="9206,3285" size="842x4467" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=3"/>
-             <XShape position="6679,4402" size="843x3350" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=2"/>
-             <XShape position="4153,5519" size="842x2233" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=1"/>
-             <XShape position="1627,6635" size="842x1117" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=0"/>
+             <XShape positionX="11732" positionY="2169" sizeX="842" sizeY="5583" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=4"/>
+             <XShape positionX="9206" positionY="3285" sizeX="842" sizeY="4467" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=3"/>
+             <XShape positionX="6679" positionY="4402" sizeX="843" sizeY="3350" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=2"/>
+             <XShape positionX="4153" positionY="5519" sizeX="842" sizeY="2233" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=1"/>
+             <XShape positionX="1627" positionY="6635" sizeX="842" sizeY="1117" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=0"/>
             </XShapes>
            </XShape>
-           <XShape position="2469,3285" size="10947x4467" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:CT=0:Series=1">
+           <XShape positionX="2469" positionY="3285" sizeX="10947" sizeY="4467" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:CT=0:Series=1">
             <XShapes>
-             <XShape position="12574,5519" size="842x2233" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=4"/>
-             <XShape position="10048,3285" size="842x4467" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=3"/>
-             <XShape position="7522,4402" size="842x3350" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=2"/>
-             <XShape position="4995,6635" size="842x1117" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=1"/>
-             <XShape position="2469,5519" size="842x2233" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=0"/>
+             <XShape positionX="12574" positionY="5519" sizeX="842" sizeY="2233" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=4"/>
+             <XShape positionX="10048" positionY="3285" sizeX="842" sizeY="4467" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=3"/>
+             <XShape positionX="7522" positionY="4402" sizeX="842" sizeY="3350" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=2"/>
+             <XShape positionX="4995" positionY="6635" sizeX="842" sizeY="1117" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=1"/>
+             <XShape positionX="2469" positionY="5519" sizeX="842" sizeY="2233" type="com.sun.star.drawing.PolyPolygonShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=0"/>
             </XShapes>
            </XShape>
           </XShapes>
@@ -68,26 +68,26 @@
        </XShape>
       </XShapes>
      </XShape>
-     <XShape position="770,854" size="11898x7546" type="com.sun.star.drawing.GroupShape">
+     <XShape positionX="770" positionY="854" sizeX="11898" sizeY="7546" type="com.sun.star.drawing.GroupShape">
       <XShapes>
-       <XShape position="2376,8002" size="10292x398" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=0,0">
+       <XShape positionX="2376" positionY="8002" sizeX="10292" sizeY="398" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=0,0">
         <XShapes>
-         <XShape position="2376,8002" size="187x398" type="com.sun.star.drawing.TextShape" text="1"/>
-         <XShape position="4902,8002" size="187x398" type="com.sun.star.drawing.TextShape" text="2"/>
-         <XShape position="7429,8002" size="187x398" type="com.sun.star.drawing.TextShape" text="3"/>
-         <XShape position="9955,8002" size="187x398" type="com.sun.star.drawing.TextShape" text="4"/>
-         <XShape position="12481,8002" size="187x398" type="com.sun.star.drawing.TextShape" text="5"/>
+         <XShape positionX="2376" positionY="8002" sizeX="187" sizeY="398" type="com.sun.star.drawing.TextShape" text="1"/>
+         <XShape positionX="4902" positionY="8002" sizeX="187" sizeY="398" type="com.sun.star.drawing.TextShape" text="2"/>
+         <XShape positionX="7429" positionY="8002" sizeX="187" sizeY="398" type="com.sun.star.drawing.TextShape" text="3"/>
+         <XShape positionX="9955" positionY="8002" sizeX="187" sizeY="398" type="com.sun.star.drawing.TextShape" text="4"/>
+         <XShape positionX="12481" positionY="8002" sizeX="187" sizeY="398" type="com.sun.star.drawing.TextShape" text="5"/>
         </XShapes>
        </XShape>
-       <XShape position="770,854" size="187x7098" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=1,0">
+       <XShape positionX="770" positionY="854" sizeX="187" sizeY="7098" type="com.sun.star.drawing.GroupShape" name="CID/D=0:CS=0:Axis=1,0">
         <XShapes>
-         <XShape position="770,7554" size="187x398" type="com.sun.star.drawing.TextShape" text="0"/>
-         <XShape position="770,6437" size="187x398" type="com.sun.star.drawing.TextShape" text="1"/>
-         <XShape position="770,5321" size="187x398" type="com.sun.star.drawing.TextShape" text="2"/>
-         <XShape position="770,4204" size="187x398" type="com.sun.star.drawing.TextShape" text="3"/>
-         <XShape position="770,3087" size="187x398" type="com.sun.star.drawing.TextShape" text="4"/>
-         <XShape position="770,1971" size="187x398" type="com.sun.star.drawing.TextShape" text="5"/>
-         <XShape position="770,854" size="187x398" type="com.sun.star.drawing.TextShape" text="6"/>
+         <XShape positionX="770" positionY="7554" sizeX="187" sizeY="398" type="com.sun.star.drawing.TextShape" text="0"/>
+         <XShape positionX="770" positionY="6437" sizeX="187" sizeY="398" type="com.sun.star.drawing.TextShape" text="1"/>
+         <XShape positionX="770" positionY="5321" sizeX="187" sizeY="398" type="com.sun.star.drawing.TextShape" text="2"/>
+         <XShape positionX="770" positionY="4204" sizeX="187" sizeY="398" type="com.sun.star.drawing.TextShape" text="3"/>
+         <XShape positionX="770" positionY="3087" sizeX="187" sizeY="398" type="com.sun.star.drawing.TextShape" text="4"/>
+         <XShape positionX="770" positionY="1971" sizeX="187" sizeY="398" type="com.sun.star.drawing.TextShape" text="5"/>
+         <XShape positionX="770" positionY="854" sizeX="187" sizeY="398" type="com.sun.star.drawing.TextShape" text="6"/>
         </XShapes>
        </XShape>
       </XShapes>
@@ -96,31 +96,31 @@
    </XShape>
   </XShapes>
  </XShape>
- <XShape position="14478,3952" size="1312x1096" type="com.sun.star.drawing.GroupShape" name="CID/D=0:Legend=">
+ <XShape positionX="14478" positionY="3952" sizeX="1312" sizeY="1096" type="com.sun.star.drawing.GroupShape" name="CID/D=0:Legend=">
   <XShapes>
-   <XShape position="14478,3952" size="1312x1096" type="com.sun.star.drawing.RectangleShape" name="MarkHandles"/>
-   <XShape position="14594,4145" size="211x211" type="com.sun.star.drawing.GroupShape">
+   <XShape positionX="14478" positionY="3952" sizeX="1312" sizeY="1096" type="com.sun.star.drawing.RectangleShape" name="MarkHandles"/>
+   <XShape positionX="14594" positionY="4145" sizeX="211" sizeY="211" type="com.sun.star.drawing.GroupShape">
     <XShapes>
-     <XShape position="14594,4145" size="211x211" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:LegendEntry=0">
+     <XShape positionX="14594" positionY="4145" sizeX="211" sizeY="211" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=0:LegendEntry=0">
       <XShapes>
-       <XShape position="14594,4145" size="211x211" type="com.sun.star.drawing.RectangleShape"/>
-       <XShape position="14594,4145" size="211x211" type="com.sun.star.drawing.RectangleShape"/>
+       <XShape positionX="14594" positionY="4145" sizeX="211" sizeY="211" type="com.sun.star.drawing.RectangleShape"/>
+       <XShape positionX="14594" positionY="4145" sizeX="211" sizeY="211" type="com.sun.star.drawing.RectangleShape"/>
       </XShapes>
      </XShape>
     </XShapes>
    </XShape>
-   <XShape position="14594,4643" size="211x211" type="com.sun.star.drawing.GroupShape">
+   <XShape positionX="14594" positionY="4643" sizeX="211" sizeY="211" type="com.sun.star.drawing.GroupShape">
     <XShapes>
-     <XShape position="14594,4643" size="211x211" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=1:LegendEntry=0">
+     <XShape positionX="14594" positionY="4643" sizeX="211" sizeY="211" type="com.sun.star.drawing.GroupShape" name="CID/MultiClick/D=0:CS=0:CT=0:Series=1:LegendEntry=0">
       <XShapes>
-       <XShape position="14594,4643" size="211x211" type="com.sun.star.drawing.RectangleShape"/>
-       <XShape position="14594,4643" size="211x211" type="com.sun.star.drawing.RectangleShape"/>
+       <XShape positionX="14594" positionY="4643" sizeX="211" sizeY="211" type="com.sun.star.drawing.RectangleShape"/>
+       <XShape positionX="14594" positionY="4643" sizeX="211" sizeY="211" type="com.sun.star.drawing.RectangleShape"/>
       </XShapes>
      </XShape>
     </XShapes>
    </XShape>
-   <XShape position="14905,4052" size="769x398" type="com.sun.star.drawing.TextShape" text="test1"/>
-   <XShape position="14905,4550" size="769x398" type="com.sun.star.drawing.TextShape" text="test2"/>
+   <XShape positionX="14905" positionY="4052" sizeX="769" sizeY="398" type="com.sun.star.drawing.TextShape" text="test1"/>
+   <XShape positionX="14905" positionY="4550" sizeX="769" sizeY="398" type="com.sun.star.drawing.TextShape" text="test2"/>
   </XShapes>
  </XShape>
 </XShapes>
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index a893062..9020d7b 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -3044,12 +3044,14 @@ int closeCallback(void* )
 
 void dumpPositionAsAttribute(const awt::Point& rPoint, xmlTextWriterPtr xmlWriter)
 {
-    xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("position"), "%" SAL_PRIdINT32 ",%" SAL_PRIdINT32, rPoint.X, rPoint.Y);
+    xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionX"), "%" SAL_PRIdINT32, rPoint.X);
+    xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("positionY"), "%" SAL_PRIdINT32, rPoint.Y);
 }
 
 void dumpSizeAsAttribute(const awt::Size& rSize, xmlTextWriterPtr xmlWriter)
 {
-    xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("size"), "%" SAL_PRIdINT32 "x%" SAL_PRIdINT32, rSize.Width, rSize.Height);
+    xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("sizeX"), "%" SAL_PRIdINT32, rSize.Width);
+    xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("sizeY"), "%" SAL_PRIdINT32, rSize.Height);
 }
 
 void dumpShapeDescriptorAsAttribute( uno::Reference< drawing::XShapeDescriptor > xDescr, xmlTextWriterPtr xmlWriter )
diff --git a/sc/qa/extras/regression-test.cxx b/sc/qa/extras/regression-test.cxx
index 98ef541..77a7557 100644
--- a/sc/qa/extras/regression-test.cxx
+++ b/sc/qa/extras/regression-test.cxx
@@ -147,6 +147,7 @@ void ScChartRegressionTest::test()
     CPPUNIT_ASSERT(xDumper.is());
 
     rtl::OUString aDump = xDumper->dump();
+    std::cout << aDump;
     bool bCompare = checkDumpAgainstFile( aDump, getPathFromSrc("/chart2/qa/unit/data/reference/testChart.xml") );
     CPPUNIT_ASSERT(bCompare);
 }
commit b1dc2c5818f9d31e58131f5b2b79a41a366fab35
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Fri Apr 27 02:13:04 2012 +0200

    use the new xml diff in chart regression test

diff --git a/sc/qa/extras/regression-test.cxx b/sc/qa/extras/regression-test.cxx
index 812e218..98ef541 100644
--- a/sc/qa/extras/regression-test.cxx
+++ b/sc/qa/extras/regression-test.cxx
@@ -51,6 +51,8 @@
 #include <com/sun/star/chart2/XChartDocument.hpp>
 #include <com/sun/star/qa/XDumper.hpp>
 
+#include <test/xmldiff.hxx>
+
 #include <basic/sbxdef.hxx>
 
 #include "docsh.hxx"
@@ -66,37 +68,13 @@ namespace {
 bool checkDumpAgainstFile( const rtl::OUString& rDump, const rtl::OUString aFilePath )
 {
     rtl::OString aOFile = rtl::OUStringToOString(aFilePath, RTL_TEXTENCODING_UTF8);
-    std::ifstream aFile(aOFile.getStr());
 
-    CPPUNIT_ASSERT_MESSAGE("file not open", aFile.is_open());
     CPPUNIT_ASSERT_MESSAGE("dump is empty", !rDump.isEmpty());
 
-    sal_Int32 nLine = 1;
-    sal_Int32 nIndex = 0;
-    while(!aFile.eof())
-    {
-        std::string aLineFile;
-
-        std::getline(aFile, aLineFile);
-        sal_Int32 nNewIndex = rDump.indexOf('\n', nIndex);
-        //CPPUNIT_ASSERT( nNewIndex != -1 );
-        if (nNewIndex == -1)
-            nNewIndex = rDump.getLength();
-        rtl::OUString aLineDump = rDump.copy(nIndex, nNewIndex-nIndex);
-        nIndex = nNewIndex+1;
-        rtl::OString aOLineDump = rtl::OUStringToOString(aLineDump, RTL_TEXTENCODING_UTF8);
-
-        if( aLineFile.compare(aOLineDump.getStr()) )
-        {
-            rtl::OStringBuffer aErrorMessage("Mismatch between reference file and dump in line ");
-            std::cout << rtl::OUStringToOString(rDump, RTL_TEXTENCODING_UTF8).getStr();
-            aErrorMessage.append(nLine).append(".\nExpected: ");
-            aErrorMessage.append(aLineFile.c_str()).append("\nFound   : ").append(aOLineDump);
-            CPPUNIT_ASSERT_MESSAGE(aErrorMessage.getStr(), false);
-        }
-        nLine++;
-    }
-    return true;
+    rtl::OString aDump = rtl::OUStringToOString(rDump, RTL_TEXTENCODING_UTF8);
+    XMLDiff aDiff(aOFile.getStr(), aDump.getStr(),static_cast<int>(rDump.getLength()));
+
+    return aDiff.compare();
 }
 
 }
diff --git a/test/inc/test/xmldiff.hxx b/test/inc/test/xmldiff.hxx
index beaea19..a787132 100644
--- a/test/inc/test/xmldiff.hxx
+++ b/test/inc/test/xmldiff.hxx
@@ -31,6 +31,9 @@
 #include <libxml/xmlmemory.h>
 #include <string>
 #include <set>
+#include <test/testdllapi.hxx>
+
+#define USE_CPPUNIT 1
 
 struct tolerance
 {
@@ -70,11 +73,12 @@ struct tolerance
     }
 };
 
-class XMLDiff
+class OOO_DLLPUBLIC_TEST XMLDiff
 {
 public:
     XMLDiff(const std::string& file1, const std::string& file2, const std::string& toleranceFile);
     XMLDiff(const std::string& file1, const std::string& file2);
+    XMLDiff(const char* pFileName, const char* pContent, int size);
     ~XMLDiff();
 
     bool compare();
diff --git a/test/source/diff/diff.cxx b/test/source/diff/diff.cxx
index 2d57a4a..6b97f29 100644
--- a/test/source/diff/diff.cxx
+++ b/test/source/diff/diff.cxx
@@ -55,6 +55,12 @@ XMLDiff::XMLDiff(const std::string& file1, const std::string& file2)
     xmlFile2 = xmlParseFile(file2.c_str());
 }
 
+XMLDiff::XMLDiff( const char* pFileName, const char* pContent, int size)
+{
+    xmlFile1 = xmlParseFile(pFileName);
+    xmlFile2 = xmlParseMemory(pContent, size);
+}
+
 XMLDiff::~XMLDiff()
 {
     xmlFreeDoc(xmlFile1);
commit 9f9e6a765450d85f2fd9339fb10fb2ee6d45cd05
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Thu Apr 26 23:57:51 2012 +0200

    add virtual to the destructor

diff --git a/svl/inc/svl/style.hxx b/svl/inc/svl/style.hxx
index f44b7d1..af0a826 100644
--- a/svl/inc/svl/style.hxx
+++ b/svl/inc/svl/style.hxx
@@ -221,7 +221,7 @@ protected:
     virtual SfxStyleSheetBase*  Create( const UniString&, SfxStyleFamily, sal_uInt16 );
     virtual SfxStyleSheetBase*  Create( const SfxStyleSheetBase& );
 
-                                ~SfxStyleSheetBasePool();
+    virtual                     ~SfxStyleSheetBasePool();
 
 public:
                                 SfxStyleSheetBasePool( SfxItemPool& );


More information about the Libreoffice-commits mailing list