CppunitTest_sd_png_export_tests: inherit from UnoApiTest
Change-Id: I0dfc7e10250e2690fa34821f8f73cfe6306d2417 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141874 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
This commit is contained in:
parent
ffe9dfbbc6
commit
932423b8f3
2 changed files with 19 additions and 41 deletions
|
@ -40,6 +40,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sd_png_export_tests, \
|
||||||
sd \
|
sd \
|
||||||
sfx \
|
sfx \
|
||||||
sot \
|
sot \
|
||||||
|
subsequenttest \
|
||||||
svl \
|
svl \
|
||||||
svt \
|
svt \
|
||||||
svx \
|
svx \
|
||||||
|
|
|
@ -10,39 +10,26 @@
|
||||||
|
|
||||||
#include <sal/config.h>
|
#include <sal/config.h>
|
||||||
|
|
||||||
#include "sdmodeltestbase.hxx"
|
#include <test/unoapi_test.hxx>
|
||||||
|
|
||||||
#include <com/sun/star/drawing/GraphicExportFilter.hpp>
|
#include <com/sun/star/drawing/GraphicExportFilter.hpp>
|
||||||
|
#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
|
||||||
#include <com/sun/star/frame/Desktop.hpp>
|
#include <com/sun/star/frame/Desktop.hpp>
|
||||||
#include <comphelper/propertyvalue.hxx>
|
#include <comphelper/propertyvalue.hxx>
|
||||||
#include <vcl/BitmapReadAccess.hxx>
|
#include <vcl/BitmapReadAccess.hxx>
|
||||||
#include <vcl/filter/PngImageReader.hxx>
|
#include <vcl/filter/PngImageReader.hxx>
|
||||||
|
|
||||||
class SdPNGExportTest : public SdModelTestBase
|
using namespace ::com::sun::star;
|
||||||
{
|
|
||||||
protected:
|
|
||||||
uno::Reference<lang::XComponent> mxComponent;
|
|
||||||
|
|
||||||
|
class SdPNGExportTest : public UnoApiTest
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
virtual void setUp() override;
|
SdPNGExportTest()
|
||||||
virtual void tearDown() override;
|
: UnoApiTest("/sd/qa/unit/data/")
|
||||||
|
{
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void SdPNGExportTest::setUp()
|
|
||||||
{
|
|
||||||
test::BootstrapFixture::setUp();
|
|
||||||
|
|
||||||
mxDesktop.set(frame::Desktop::create(mxComponentContext));
|
|
||||||
}
|
|
||||||
|
|
||||||
void SdPNGExportTest::tearDown()
|
|
||||||
{
|
|
||||||
if (mxComponent.is())
|
|
||||||
mxComponent->dispose();
|
|
||||||
|
|
||||||
test::BootstrapFixture::tearDown();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void assertColorsAreSimilar(const std::string& message, const BitmapColor& expected,
|
static void assertColorsAreSimilar(const std::string& message, const BitmapColor& expected,
|
||||||
const BitmapColor& actual, int nDelta)
|
const BitmapColor& actual, int nDelta)
|
||||||
{
|
{
|
||||||
|
@ -55,8 +42,7 @@ static void assertColorsAreSimilar(const std::string& message, const BitmapColor
|
||||||
|
|
||||||
CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf105998)
|
CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf105998)
|
||||||
{
|
{
|
||||||
mxComponent
|
loadFromURL(u"odp/tdf105998.odp");
|
||||||
= loadFromDesktop(m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/tdf105998.odp"));
|
|
||||||
uno::Reference<uno::XComponentContext> xContext = getComponentContext();
|
uno::Reference<uno::XComponentContext> xContext = getComponentContext();
|
||||||
CPPUNIT_ASSERT(xContext.is());
|
CPPUNIT_ASSERT(xContext.is());
|
||||||
uno::Reference<drawing::XGraphicExportFilter> xGraphicExporter
|
uno::Reference<drawing::XGraphicExportFilter> xGraphicExporter
|
||||||
|
@ -120,8 +106,7 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf105998)
|
||||||
|
|
||||||
CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf126319)
|
CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf126319)
|
||||||
{
|
{
|
||||||
mxComponent
|
loadFromURL(u"odg/tdf126319.odg");
|
||||||
= loadFromDesktop(m_directories.getURLFromSrc(u"/sd/qa/unit/data/odg/tdf126319.odg"));
|
|
||||||
uno::Reference<uno::XComponentContext> xContext = getComponentContext();
|
uno::Reference<uno::XComponentContext> xContext = getComponentContext();
|
||||||
CPPUNIT_ASSERT(xContext.is());
|
CPPUNIT_ASSERT(xContext.is());
|
||||||
uno::Reference<drawing::XGraphicExportFilter> xGraphicExporter
|
uno::Reference<drawing::XGraphicExportFilter> xGraphicExporter
|
||||||
|
@ -191,8 +176,7 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf126319)
|
||||||
CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf136632)
|
CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf136632)
|
||||||
{
|
{
|
||||||
// Reuse existing file
|
// Reuse existing file
|
||||||
mxComponent
|
loadFromURL(u"odp/tdf105998.odp");
|
||||||
= loadFromDesktop(m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/tdf105998.odp"));
|
|
||||||
uno::Reference<uno::XComponentContext> xContext = getComponentContext();
|
uno::Reference<uno::XComponentContext> xContext = getComponentContext();
|
||||||
CPPUNIT_ASSERT(xContext.is());
|
CPPUNIT_ASSERT(xContext.is());
|
||||||
uno::Reference<drawing::XGraphicExportFilter> xGraphicExporter
|
uno::Reference<drawing::XGraphicExportFilter> xGraphicExporter
|
||||||
|
@ -229,8 +213,7 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf136632)
|
||||||
|
|
||||||
CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf113163)
|
CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf113163)
|
||||||
{
|
{
|
||||||
mxComponent
|
loadFromURL(u"pptx/tdf113163.pptx");
|
||||||
= loadFromDesktop(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf113163.pptx"));
|
|
||||||
uno::Reference<uno::XComponentContext> xContext = getComponentContext();
|
uno::Reference<uno::XComponentContext> xContext = getComponentContext();
|
||||||
CPPUNIT_ASSERT(xContext.is());
|
CPPUNIT_ASSERT(xContext.is());
|
||||||
uno::Reference<drawing::XGraphicExportFilter> xGraphicExporter
|
uno::Reference<drawing::XGraphicExportFilter> xGraphicExporter
|
||||||
|
@ -283,8 +266,7 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf113163)
|
||||||
|
|
||||||
CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf147119)
|
CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf147119)
|
||||||
{
|
{
|
||||||
mxComponent
|
loadFromURL(u"odg/tdf147119.odg");
|
||||||
= loadFromDesktop(m_directories.getURLFromSrc(u"/sd/qa/unit/data/odg/tdf147119.odg"));
|
|
||||||
uno::Reference<uno::XComponentContext> xContext = getComponentContext();
|
uno::Reference<uno::XComponentContext> xContext = getComponentContext();
|
||||||
CPPUNIT_ASSERT(xContext.is());
|
CPPUNIT_ASSERT(xContext.is());
|
||||||
uno::Reference<drawing::XGraphicExportFilter> xGraphicExporter
|
uno::Reference<drawing::XGraphicExportFilter> xGraphicExporter
|
||||||
|
@ -336,8 +318,7 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf147119)
|
||||||
|
|
||||||
CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf113197)
|
CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf113197)
|
||||||
{
|
{
|
||||||
mxComponent
|
loadFromURL(u"odp/tdf113197.odp");
|
||||||
= loadFromDesktop(m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/tdf113197.odp"));
|
|
||||||
uno::Reference<uno::XComponentContext> xContext = getComponentContext();
|
uno::Reference<uno::XComponentContext> xContext = getComponentContext();
|
||||||
CPPUNIT_ASSERT(xContext.is());
|
CPPUNIT_ASSERT(xContext.is());
|
||||||
uno::Reference<drawing::XGraphicExportFilter> xGraphicExporter
|
uno::Reference<drawing::XGraphicExportFilter> xGraphicExporter
|
||||||
|
@ -391,8 +372,7 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf113197)
|
||||||
|
|
||||||
CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf93124)
|
CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf93124)
|
||||||
{
|
{
|
||||||
mxComponent
|
loadFromURL(u"ppt/tdf93124.ppt");
|
||||||
= loadFromDesktop(m_directories.getURLFromSrc(u"/sd/qa/unit/data/ppt/tdf93124.ppt"));
|
|
||||||
uno::Reference<uno::XComponentContext> xContext = getComponentContext();
|
uno::Reference<uno::XComponentContext> xContext = getComponentContext();
|
||||||
CPPUNIT_ASSERT(xContext.is());
|
CPPUNIT_ASSERT(xContext.is());
|
||||||
uno::Reference<drawing::XGraphicExportFilter> xGraphicExporter
|
uno::Reference<drawing::XGraphicExportFilter> xGraphicExporter
|
||||||
|
@ -446,14 +426,12 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf93124)
|
||||||
|
|
||||||
CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf99729)
|
CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf99729)
|
||||||
{
|
{
|
||||||
const OUString filenames[]
|
const OUString filenames[] = { "odp/tdf99729-new.odp", "odp/tdf99729-legacy.odp" };
|
||||||
= { "/sd/qa/unit/data/odp/tdf99729-new.odp", "/sd/qa/unit/data/odp/tdf99729-legacy.odp" };
|
|
||||||
int nonwhitecounts[] = { 0, 0 };
|
int nonwhitecounts[] = { 0, 0 };
|
||||||
for (size_t i = 0; i < SAL_N_ELEMENTS(filenames); ++i)
|
for (size_t i = 0; i < SAL_N_ELEMENTS(filenames); ++i)
|
||||||
{
|
{
|
||||||
// 1st check for new behaviour - having AnchoredTextOverflowLegacy compatibility flag set to false in settings.xml
|
// 1st check for new behaviour - having AnchoredTextOverflowLegacy compatibility flag set to false in settings.xml
|
||||||
mxComponent = loadFromDesktop(m_directories.getURLFromSrc(filenames[i]),
|
loadFromURL(filenames[i]);
|
||||||
"com.sun.star.presentation.PresentationDocument");
|
|
||||||
|
|
||||||
uno::Reference<uno::XComponentContext> xContext = getComponentContext();
|
uno::Reference<uno::XComponentContext> xContext = getComponentContext();
|
||||||
CPPUNIT_ASSERT(xContext.is());
|
CPPUNIT_ASSERT(xContext.is());
|
||||||
|
@ -497,7 +475,6 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf99729)
|
||||||
++nonwhitecounts[i];
|
++nonwhitecounts[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mxComponent->dispose();
|
|
||||||
}
|
}
|
||||||
// The numbers 1-9 should be above the Text Box in rectangle 154,16 - 170,112.
|
// The numbers 1-9 should be above the Text Box in rectangle 154,16 - 170,112.
|
||||||
// If text alignment is wrong, the rectangle will be white.
|
// If text alignment is wrong, the rectangle will be white.
|
||||||
|
|
Loading…
Reference in a new issue