From 994a00eb3d9010a54ffb4f07430925af557a7e12 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Thu, 12 Jul 2012 03:02:00 +0200 Subject: use XMLDiff for the new impress regression test Change-Id: Ib0182fe25e7a2534acf85e7fabe1355491d9a9e7 --- sd/qa/unit/data/tolerance.xml | 3 + sd/qa/unit/data/xml/shapes-test_page0.xml | 473 ++++++++++++++++++++ sd/qa/unit/data/xml/shapes-test_page1.xml | 255 +++++++++++ sd/qa/unit/data/xml/shapes-test_page2.xml | 392 ++++++++++++++++ sd/qa/unit/data/xml/shapes-test_page3.xml | 714 ++++++++++++++++++++++++++++++ sd/qa/unit/data/xml/shapes-test_page4.xml | 115 +++++ sd/qa/unit/data/xml/shapes-test_page5.xml | 91 ++++ sd/qa/unit/data/xml/shapes-test_page6.xml | 5 + sd/qa/unit/data/xml/shapes-test_page7.xml | 10 + sd/qa/unit/regression-test.cxx | 19 +- 10 files changed, 2073 insertions(+), 4 deletions(-) create mode 100644 sd/qa/unit/data/tolerance.xml create mode 100644 sd/qa/unit/data/xml/shapes-test_page0.xml create mode 100644 sd/qa/unit/data/xml/shapes-test_page1.xml create mode 100644 sd/qa/unit/data/xml/shapes-test_page2.xml create mode 100644 sd/qa/unit/data/xml/shapes-test_page3.xml create mode 100644 sd/qa/unit/data/xml/shapes-test_page4.xml create mode 100644 sd/qa/unit/data/xml/shapes-test_page5.xml create mode 100644 sd/qa/unit/data/xml/shapes-test_page6.xml create mode 100644 sd/qa/unit/data/xml/shapes-test_page7.xml (limited to 'sd/qa') diff --git a/sd/qa/unit/data/tolerance.xml b/sd/qa/unit/data/tolerance.xml new file mode 100644 index 000000000000..167dfb61b88c --- /dev/null +++ b/sd/qa/unit/data/tolerance.xml @@ -0,0 +1,3 @@ + + + diff --git a/sd/qa/unit/data/xml/shapes-test_page0.xml b/sd/qa/unit/data/xml/shapes-test_page0.xml new file mode 100644 index 000000000000..731c050f9519 --- /dev/null +++ b/sd/qa/unit/data/xml/shapes-test_page0.xml @@ -0,0 +1,473 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sd/qa/unit/data/xml/shapes-test_page1.xml b/sd/qa/unit/data/xml/shapes-test_page1.xml new file mode 100644 index 000000000000..149285914bef --- /dev/null +++ b/sd/qa/unit/data/xml/shapes-test_page1.xml @@ -0,0 +1,255 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sd/qa/unit/data/xml/shapes-test_page2.xml b/sd/qa/unit/data/xml/shapes-test_page2.xml new file mode 100644 index 000000000000..f8b3735f995d --- /dev/null +++ b/sd/qa/unit/data/xml/shapes-test_page2.xml @@ -0,0 +1,392 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sd/qa/unit/data/xml/shapes-test_page3.xml b/sd/qa/unit/data/xml/shapes-test_page3.xml new file mode 100644 index 000000000000..013999f5db62 --- /dev/null +++ b/sd/qa/unit/data/xml/shapes-test_page3.xml @@ -0,0 +1,714 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sd/qa/unit/data/xml/shapes-test_page4.xml b/sd/qa/unit/data/xml/shapes-test_page4.xml new file mode 100644 index 000000000000..ae6673274074 --- /dev/null +++ b/sd/qa/unit/data/xml/shapes-test_page4.xml @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sd/qa/unit/data/xml/shapes-test_page5.xml b/sd/qa/unit/data/xml/shapes-test_page5.xml new file mode 100644 index 000000000000..69d48ab4e109 --- /dev/null +++ b/sd/qa/unit/data/xml/shapes-test_page5.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sd/qa/unit/data/xml/shapes-test_page6.xml b/sd/qa/unit/data/xml/shapes-test_page6.xml new file mode 100644 index 000000000000..45ef536763aa --- /dev/null +++ b/sd/qa/unit/data/xml/shapes-test_page6.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/sd/qa/unit/data/xml/shapes-test_page7.xml b/sd/qa/unit/data/xml/shapes-test_page7.xml new file mode 100644 index 000000000000..3170a3bb3e9c --- /dev/null +++ b/sd/qa/unit/data/xml/shapes-test_page7.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/sd/qa/unit/regression-test.cxx b/sd/qa/unit/regression-test.cxx index 5fd09f5bbcdc..7cb0609ec8f8 100644 --- a/sd/qa/unit/regression-test.cxx +++ b/sd/qa/unit/regression-test.cxx @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -119,7 +120,7 @@ public: private: uno::Reference m_xFilter; uno::Reference m_xDrawComponent; - void testStuff(::sd::DrawDocShellRef xDocShRef); + void testStuff(::sd::DrawDocShellRef xDocShRef, const rtl::OString& fileNameBase); }; #define PPTX_FORMAT_TYPE 268959811 @@ -175,8 +176,8 @@ FileFormat aFileFormats[] = { void SdFiltersTest::test() { { - ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/odp/shapes-test.odp")); - testStuff(xDocShRef); + ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/odp/shapes-test.odp")); + testStuff(xDocShRef, rtl::OUStringToOString(getPathFromSrc("/sd/qa/unit/data/xml/shapes-test_page"), RTL_TEXTENCODING_UTF8)); } /* { @@ -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( "not in destruction", !xDocShRef->IsInDestruction() ); @@ -199,6 +200,7 @@ void SdFiltersTest::testStuff(::sd::DrawDocShellRef xDocShRef) XShapeDumper xShapeDumper; sal_Int32 nLength = xDrawPages->getCount(); + rtl::OString aFileNameExt(".xml"); for (sal_Int32 i = 0; i < nLength; ++i) { uno::Reference xDrawPage; @@ -206,7 +208,16 @@ void SdFiltersTest::testStuff(::sd::DrawDocShellRef xDocShRef) aAny >>= xDrawPage; uno::Reference< drawing::XShapes > xShapes(xDrawPage, uno::UNO_QUERY_THROW); 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(aString.getLength()), + rtl::OUStringToOString(getPathFromSrc("/sd/qa/unit/data/tolerance.xml"), RTL_TEXTENCODING_UTF8).getStr()); std::cout << aString << std::endl; + aDiff.compare(); } xDocShRef->DoClose(); } -- cgit