Kaydet (Commit) 994a00eb authored tarafından Markus Mohrhard's avatar Markus Mohrhard

use XMLDiff for the new impress regression test

Change-Id: Ib0182fe25e7a2534acf85e7fabe1355491d9a9e7
üst ea7cce1d
<?xml version="1.0"?>
<tolerances>
</tolerances>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<?xml version="1.0"?>
<XShapes>
<XShape positionX="4000" positionY="3200" sizeX="4800" sizeY="4200" type="com.sun.star.drawing.CustomShape" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="BLOCK" textVerticalAdjust="CENTER" textLeftDistance="250" textRightDistance="250" textUpperDistance="125" textLowerDistance="125" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="HATCH" fillColor="13625333" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="8421504" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="TRIPLE" color="255" distance="102" angle="900"/>
<FillBitmap width="32" height="32"/>
<LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
<LineStart/>
<LineEnd/>
<Transformation>
<Line1 column1="4801.000000" column2="0.000000" column3="4000.000000"/>
<Line2 column1="0.000000" column2="4201.000000" column3="3200.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
<CustomShapeGeometry>
<PropertyValue name="ViewBox" handle="0" propertyState="DIRECT_VALUE"/>
<PropertyValue name="Type" handle="0" value="quad-bevel" propertyState="DIRECT_VALUE"/>
<PropertyValue name="AdjustmentValues" handle="0" propertyState="DIRECT_VALUE"/>
<PropertyValue name="Path" handle="0" propertyState="DIRECT_VALUE"/>
<PropertyValue name="Equations" handle="0" propertyState="DIRECT_VALUE"/>
<PropertyValue name="Handles" handle="0" propertyState="DIRECT_VALUE"/>
</CustomShapeGeometry>
</XShape>
<XShape positionX="16000" positionY="2200" sizeX="5800" sizeY="4400" type="com.sun.star.drawing.CustomShape" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="BLOCK" textVerticalAdjust="CENTER" textLeftDistance="250" textRightDistance="250" textUpperDistance="125" textLowerDistance="125" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="750" textMinimumFrameWidth="500" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="HATCH" fillColor="13625333" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="8421504" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="0" distance="102" angle="450"/>
<FillBitmap width="32" height="32"/>
<LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
<LineStart/>
<LineEnd/>
<Transformation>
<Line1 column1="5801.000000" column2="0.000000" column3="16000.000000"/>
<Line2 column1="0.000000" column2="4401.000000" column3="2200.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
<CustomShapeGeometry>
<PropertyValue name="ViewBox" handle="0" propertyState="DIRECT_VALUE"/>
<PropertyValue name="Type" handle="0" value="col-60da8460" propertyState="DIRECT_VALUE"/>
<PropertyValue name="AdjustmentValues" handle="0" propertyState="DIRECT_VALUE"/>
<PropertyValue name="Path" handle="0" propertyState="DIRECT_VALUE"/>
<PropertyValue name="Equations" handle="0" propertyState="DIRECT_VALUE"/>
<PropertyValue name="Handles" handle="0" propertyState="DIRECT_VALUE"/>
</CustomShapeGeometry>
</XShape>
<XShape positionX="6600" positionY="10200" sizeX="4600" sizeY="8800" type="com.sun.star.drawing.CustomShape" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="BLOCK" textVerticalAdjust="CENTER" textLeftDistance="250" textRightDistance="250" textUpperDistance="125" textLowerDistance="125" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="66" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="HATCH" fillColor="13625333" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="8421504" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="DOUBLE" color="8388608" distance="76" angle="900"/>
<FillBitmap width="32" height="32"/>
<LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
<LineStart/>
<LineEnd/>
<Transformation>
<Line1 column1="4601.000000" column2="0.000000" column3="6600.000000"/>
<Line2 column1="0.000000" column2="8801.000000" column3="10200.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
<CustomShapeGeometry>
<PropertyValue name="ViewBox" handle="0" propertyState="DIRECT_VALUE"/>
<PropertyValue name="Type" handle="0" value="col-502ad400" propertyState="DIRECT_VALUE"/>
<PropertyValue name="AdjustmentValues" handle="0" propertyState="DIRECT_VALUE"/>
<PropertyValue name="Path" handle="0" propertyState="DIRECT_VALUE"/>
<PropertyValue name="Equations" handle="0" propertyState="DIRECT_VALUE"/>
<PropertyValue name="Handles" handle="0" propertyState="DIRECT_VALUE"/>
</CustomShapeGeometry>
</XShape>
<XShape positionX="14400" positionY="10200" sizeX="7600" sizeY="2600" type="com.sun.star.drawing.CustomShape" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="BLOCK" textVerticalAdjust="CENTER" textLeftDistance="250" textRightDistance="250" textUpperDistance="125" textLowerDistance="125" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="HATCH" fillColor="13625333" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="8421504" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="0" distance="102" angle="900"/>
<FillBitmap width="32" height="32"/>
<LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
<LineStart/>
<LineEnd/>
<Transformation>
<Line1 column1="7601.000000" column2="0.000000" column3="14400.000000"/>
<Line2 column1="0.000000" column2="2601.000000" column3="10200.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
<CustomShapeGeometry>
<PropertyValue name="ViewBox" handle="0" propertyState="DIRECT_VALUE"/>
<PropertyValue name="Type" handle="0" value="quad-bevel" propertyState="DIRECT_VALUE"/>
<PropertyValue name="AdjustmentValues" handle="0" propertyState="DIRECT_VALUE"/>
<PropertyValue name="Path" handle="0" propertyState="DIRECT_VALUE"/>
<PropertyValue name="Equations" handle="0" propertyState="DIRECT_VALUE"/>
<PropertyValue name="Handles" handle="0" propertyState="DIRECT_VALUE"/>
</CustomShapeGeometry>
</XShape>
</XShapes>
<?xml version="1.0"?>
<XShapes>
<XShape positionX="6753" positionY="13803" sizeX="14098" sizeY="971" type="com.sun.star.drawing.TableShape"/>
<XShape positionX="2108" positionY="1361" sizeX="14098" sizeY="9184" type="com.sun.star.drawing.TableShape"/>
</XShapes>
<?xml version="1.0"?>
<XShapes>
<XShape positionX="1361" positionY="9000" sizeX="24639" sizeY="7858" type="com.sun.star.presentation.GraphicObjectShape" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="CENTER" textLeftDistance="250" textRightDistance="250" textUpperDistance="125" textLowerDistance="125" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" shadow="false" shadowColor="8421504" shadowTransparence="0" shadowXDistance="200" shadowYDistance="200" zOrder="0" layerID="0" layerName="layout" visible="true" printable="true" moveProtect="false" name="" sizeProtect="false">
<Transformation>
<Line1 column1="24640.000000" column2="0.000000" column3="1361.000000"/>
<Line2 column1="0.000000" column2="7859.000000" column3="9000.000000"/>
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation>
</XShape>
</XShapes>
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <sal/config.h> #include <sal/config.h>
#include <unotest/filters-test.hxx> #include <unotest/filters-test.hxx>
#include <test/bootstrapfixture.hxx> #include <test/bootstrapfixture.hxx>
#include <test/xmldiff.hxx>
#include <rtl/strbuf.hxx> #include <rtl/strbuf.hxx>
#include <osl/file.hxx> #include <osl/file.hxx>
#include <com/sun/star/lang/XComponent.hpp> #include <com/sun/star/lang/XComponent.hpp>
...@@ -119,7 +120,7 @@ public: ...@@ -119,7 +120,7 @@ public:
private: private:
uno::Reference<document::XFilter> m_xFilter; uno::Reference<document::XFilter> m_xFilter;
uno::Reference<uno::XInterface> m_xDrawComponent; uno::Reference<uno::XInterface> m_xDrawComponent;
void testStuff(::sd::DrawDocShellRef xDocShRef); void testStuff(::sd::DrawDocShellRef xDocShRef, const rtl::OString& fileNameBase);
}; };
#define PPTX_FORMAT_TYPE 268959811 #define PPTX_FORMAT_TYPE 268959811
...@@ -175,8 +176,8 @@ FileFormat aFileFormats[] = { ...@@ -175,8 +176,8 @@ FileFormat aFileFormats[] = {
void SdFiltersTest::test() void SdFiltersTest::test()
{ {
{ {
::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/odp/shapes-test.odp")); ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/odp/shapes-test.odp"));
testStuff(xDocShRef); testStuff(xDocShRef, rtl::OUStringToOString(getPathFromSrc("/sd/qa/unit/data/xml/shapes-test_page"), RTL_TEXTENCODING_UTF8));
} }
/* /*
{ {
...@@ -185,7 +186,7 @@ void SdFiltersTest::test() ...@@ -185,7 +186,7 @@ void SdFiltersTest::test()
}*/ }*/
} }
void SdFiltersTest::testStuff(::sd::DrawDocShellRef xDocShRef) void SdFiltersTest::testStuff(::sd::DrawDocShellRef xDocShRef, const rtl::OString& fileNameBase)
{ {
CPPUNIT_ASSERT_MESSAGE( "failed to load", xDocShRef.Is() ); CPPUNIT_ASSERT_MESSAGE( "failed to load", xDocShRef.Is() );
CPPUNIT_ASSERT_MESSAGE( "not in destruction", !xDocShRef->IsInDestruction() ); CPPUNIT_ASSERT_MESSAGE( "not in destruction", !xDocShRef->IsInDestruction() );
...@@ -199,6 +200,7 @@ void SdFiltersTest::testStuff(::sd::DrawDocShellRef xDocShRef) ...@@ -199,6 +200,7 @@ void SdFiltersTest::testStuff(::sd::DrawDocShellRef xDocShRef)
XShapeDumper xShapeDumper; XShapeDumper xShapeDumper;
sal_Int32 nLength = xDrawPages->getCount(); sal_Int32 nLength = xDrawPages->getCount();
rtl::OString aFileNameExt(".xml");
for (sal_Int32 i = 0; i < nLength; ++i) for (sal_Int32 i = 0; i < nLength; ++i)
{ {
uno::Reference<drawing::XDrawPage> xDrawPage; uno::Reference<drawing::XDrawPage> xDrawPage;
...@@ -206,7 +208,16 @@ void SdFiltersTest::testStuff(::sd::DrawDocShellRef xDocShRef) ...@@ -206,7 +208,16 @@ void SdFiltersTest::testStuff(::sd::DrawDocShellRef xDocShRef)
aAny >>= xDrawPage; aAny >>= xDrawPage;
uno::Reference< drawing::XShapes > xShapes(xDrawPage, uno::UNO_QUERY_THROW); uno::Reference< drawing::XShapes > xShapes(xDrawPage, uno::UNO_QUERY_THROW);
rtl::OUString aString = xShapeDumper.dump(xShapes); rtl::OUString aString = xShapeDumper.dump(xShapes);
rtl::OStringBuffer aFileNameBuf(fileNameBase);
aFileNameBuf.append(i);
aFileNameBuf.append(aFileNameExt);
rtl::OString aFileName = aFileNameBuf.makeStringAndClear();
XMLDiff aDiff(aFileName.getStr(), rtl::OUStringToOString(aString, RTL_TEXTENCODING_UTF8).getStr(), static_cast<int>(aString.getLength()),
rtl::OUStringToOString(getPathFromSrc("/sd/qa/unit/data/tolerance.xml"), RTL_TEXTENCODING_UTF8).getStr());
std::cout << aString << std::endl; std::cout << aString << std::endl;
aDiff.compare();
} }
xDocShRef->DoClose(); xDocShRef->DoClose();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment