oox/CppunitTest_oox_mathml.mk | 1 + oox/qa/unit/mathml.cxx | 40 +++++++++------------------------------- 2 files changed, 10 insertions(+), 31 deletions(-)
New commits: commit 580776cdc5b6a6cc73771e0875ead0ab87a6c69b Author: Xisco Fauli <[email protected]> AuthorDate: Wed Oct 26 08:52:46 2022 +0200 Commit: Xisco Fauli <[email protected]> CommitDate: Wed Oct 26 10:22:40 2022 +0200 CppunitTest_oox_mathml: inherit from UnoApiTest Change-Id: I163fd8d635a18c1dd03eaa50720d10d4fe78d4cb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141857 Tested-by: Jenkins Reviewed-by: Xisco Fauli <[email protected]> diff --git a/oox/CppunitTest_oox_mathml.mk b/oox/CppunitTest_oox_mathml.mk index e358a9666fc3..7021eccc5279 100644 --- a/oox/CppunitTest_oox_mathml.mk +++ b/oox/CppunitTest_oox_mathml.mk @@ -24,6 +24,7 @@ $(eval $(call gb_CppunitTest_use_libraries,oox_mathml, \ cppu \ oox \ sal \ + subsequenttest \ test \ unotest \ )) diff --git a/oox/qa/unit/mathml.cxx b/oox/qa/unit/mathml.cxx index 3ab87fcbcc1f..62a9b99896b6 100644 --- a/oox/qa/unit/mathml.cxx +++ b/oox/qa/unit/mathml.cxx @@ -7,8 +7,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include <test/bootstrapfixture.hxx> -#include <unotest/macros_test.hxx> +#include <test/unoapi_test.hxx> #include <com/sun/star/drawing/XDrawPagesSupplier.hpp> #include <com/sun/star/frame/Desktop.hpp> @@ -16,46 +15,25 @@ using namespace ::com::sun::star; /// oox mathml tests. -class OoxMathmlTest : public test::BootstrapFixture, public unotest::MacrosTest +class OoxMathmlTest : public UnoApiTest { -private: - uno::Reference<lang::XComponent> mxComponent; - public: - void setUp() override; - void tearDown() override; - uno::Reference<lang::XComponent>& getComponent() { return mxComponent; } + OoxMathmlTest() + : UnoApiTest("/oox/qa/unit/data/") + { + } }; -void OoxMathmlTest::setUp() -{ - test::BootstrapFixture::setUp(); - - mxDesktop.set(frame::Desktop::create(mxComponentContext)); -} - -void OoxMathmlTest::tearDown() -{ - if (mxComponent.is()) - mxComponent->dispose(); - - test::BootstrapFixture::tearDown(); -} - -constexpr OUStringLiteral DATA_DIRECTORY = u"/oox/qa/unit/data/"; - CPPUNIT_TEST_FIXTURE(OoxMathmlTest, testImportCharacters) { - OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "import-characters.pptx"; // Without the accompanying fix in place, this failed with an assertion failure on import. - getComponent() = loadFromDesktop(aURL); + loadFromURL(u"import-characters.pptx"); } CPPUNIT_TEST_FIXTURE(OoxMathmlTest, testImportMce) { - OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "import-mce.pptx"; - getComponent() = loadFromDesktop(aURL); - uno::Reference<drawing::XDrawPagesSupplier> xDrawPagesSupplier(getComponent(), uno::UNO_QUERY); + loadFromURL(u"import-mce.pptx"); + uno::Reference<drawing::XDrawPagesSupplier> xDrawPagesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<drawing::XDrawPage> xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0), uno::UNO_QUERY);
