summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2022-10-26 08:52:46 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2022-10-26 10:22:40 +0200
commit580776cdc5b6a6cc73771e0875ead0ab87a6c69b (patch)
treea001e8c57c9dd9dc0aa72b363515b0b18c51fba3 /oox
parent2f795bb8bbb77a1c06260768e8d515b58dac8bce (diff)
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 <xiscofauli@libreoffice.org>
Diffstat (limited to 'oox')
-rw-r--r--oox/CppunitTest_oox_mathml.mk1
-rw-r--r--oox/qa/unit/mathml.cxx40
2 files changed, 10 insertions, 31 deletions
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);