diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-11-01 11:04:34 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-11-01 12:33:41 +0100 |
commit | 39ed6101c95368697bfaedf73f070129b24d03c9 (patch) | |
tree | 9026c740bce9af51d96b3af81c0528aa50eee44d /emfio | |
parent | 4e5df4c2777df3dcddffe0efdfceca55b3101bdf (diff) |
CppunitTest_emfio_emf: inherit from UnoApiTest
Change-Id: If1278f336aaff56a4378dcc1f0f95e0a749b629d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142099
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'emfio')
-rw-r--r-- | emfio/CppunitTest_emfio_emf.mk | 1 | ||||
-rw-r--r-- | emfio/qa/cppunit/emf/EmfImportTest.cxx | 33 |
2 files changed, 9 insertions, 25 deletions
diff --git a/emfio/CppunitTest_emfio_emf.mk b/emfio/CppunitTest_emfio_emf.mk index 38a1c98250f7..4b7d55292485 100644 --- a/emfio/CppunitTest_emfio_emf.mk +++ b/emfio/CppunitTest_emfio_emf.mk @@ -28,6 +28,7 @@ $(eval $(call gb_CppunitTest_use_libraries,emfio_emf,\ cppuhelper \ comphelper \ sal \ + subsequenttest \ svt \ test \ unotest \ diff --git a/emfio/qa/cppunit/emf/EmfImportTest.cxx b/emfio/qa/cppunit/emf/EmfImportTest.cxx index fd89ade0c899..6c1e30d57ca4 100644 --- a/emfio/qa/cppunit/emf/EmfImportTest.cxx +++ b/emfio/qa/cppunit/emf/EmfImportTest.cxx @@ -10,9 +10,8 @@ #include <sal/config.h> #include <config_fonts.h> -#include <test/bootstrapfixture.hxx> +#include <test/unoapi_test.hxx> #include <test/xmltesttools.hxx> -#include <unotest/macros_test.hxx> #include <com/sun/star/frame/Desktop.hpp> #include <com/sun/star/drawing/XDrawPagesSupplier.hpp> @@ -39,9 +38,8 @@ using namespace css::graphic; using drawinglayer::primitive2d::Primitive2DSequence; using drawinglayer::primitive2d::Primitive2DContainer; -class Test : public test::BootstrapFixture, public XmlTestTools, public unotest::MacrosTest +class Test : public UnoApiTest, public XmlTestTools { - uno::Reference<lang::XComponent> mxComponent; const OString aXPathPrefix = "/primitive2D/metafile/transform/"; void testPolyPolygon(); @@ -91,9 +89,10 @@ class Test : public test::BootstrapFixture, public XmlTestTools, public unotest: Primitive2DSequence parseEmf(std::u16string_view aSource); public: - void setUp() override; - void tearDown() override; - uno::Reference<lang::XComponent>& getComponent() { return mxComponent; } + Test() + : UnoApiTest("/emfio/qa/cppunit/emf/data/") + { + } CPPUNIT_TEST_SUITE(Test); CPPUNIT_TEST(testPolyPolygon); @@ -141,21 +140,6 @@ public: CPPUNIT_TEST_SUITE_END(); }; -void Test::setUp() -{ - test::BootstrapFixture::setUp(); - - mxDesktop.set(frame::Desktop::create(mxComponentContext)); -} - -void Test::tearDown() -{ - if (mxComponent.is()) - mxComponent->dispose(); - - test::BootstrapFixture::tearDown(); -} - Primitive2DSequence Test::parseEmf(std::u16string_view aSource) { const Reference<XEmfParser> xEmfParser = EmfTools::create(m_xContext); @@ -1604,11 +1588,10 @@ void Test::TestPdfInEmf() } // Load a PPTX file, which has a shape, with a bitmap fill, which is an EMF, containing a PDF. - OUString aURL = m_directories.getURLFromSrc(u"emfio/qa/cppunit/emf/data/pdf-in-emf.pptx"); - getComponent() = loadFromDesktop(aURL); + loadFromURL(u"pdf-in-emf.pptx"); // Get the EMF. - uno::Reference<drawing::XDrawPagesSupplier> xDrawPagesSupplier(getComponent(), uno::UNO_QUERY); + uno::Reference<drawing::XDrawPagesSupplier> xDrawPagesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<drawing::XDrawPage> xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0), uno::UNO_QUERY); uno::Reference<beans::XPropertySet> xShape(xDrawPage->getByIndex(0), uno::UNO_QUERY); |