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 -#include +#include #include #include @@ -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 mxComponent; - public: - void setUp() override; - void tearDown() override; - uno::Reference& 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 xDrawPagesSupplier(getComponent(), uno::UNO_QUERY); + loadFromURL(u"import-mce.pptx"); + uno::Reference xDrawPagesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0), uno::UNO_QUERY);