sw/qa/extras/ooxmlimport/ooxmlimport.cxx |   37 ++++---------------------------
 1 file changed, 5 insertions(+), 32 deletions(-)

New commits:
commit 6cd8dd2123354578a1499a1e85e268f702f38954
Author:     Miklos Vajna <vmik...@collabora.com>
AuthorDate: Tue Jun 8 20:47:57 2021 +0200
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Wed Jun 9 09:03:34 2021 +0200

    CppunitTest_sw_ooxmlimport: rework to avoid the FailTest hack
    
    Change-Id: Ic59398c15f4caa04191dbf4d6252361a330fc8c1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116863
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index b9b09d765eef..deb17d50fb23 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -68,45 +68,16 @@
 #include <vcl/TypeSerializer.hxx>
 #include <comphelper/scopeguard.hxx>
 
+constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/extras/ooxmlimport/data/";
 
 class Test : public SwModelTestBase
 {
 public:
-    Test() : SwModelTestBase("/sw/qa/extras/ooxmlimport/data/", "Office Open 
XML Text")
+    Test() : SwModelTestBase(DATA_DIRECTORY, "Office Open XML Text")
     {
     }
 };
 
-class FailTest : public Test
-{
-public:
-    // UGLY: hacky manual override of MacrosTest::loadFromDesktop
-    void executeImportTest(const char* filename, const char* /*password*/)
-    {
-        header();
-        preTest(filename);
-        {
-            if (mxComponent.is())
-                mxComponent->dispose();
-            std::cout << filename << ",";
-            mnStartTime = osl_getGlobalTimer();
-            {
-                OUString aURL(m_directories.getURLFromSrc(mpTestDocumentPath) 
+ OUString::createFromAscii(filename));
-                CPPUNIT_ASSERT_MESSAGE("no desktop", mxDesktop.is());
-                uno::Sequence<beans::PropertyValue> args( 
comphelper::InitPropertySequence({
-                        { "DocumentService", 
uno::Any(OUString("com.sun.star.text.TextDocument")) }
-                    }));
-
-                uno::Reference<lang::XComponent> xComponent = 
mxDesktop->loadComponentFromURL(aURL, "_default", 0, args);
-                OUString sMessage = "loading succeeded: " + aURL;
-                CPPUNIT_ASSERT_MESSAGE(OUStringToOString(sMessage, 
RTL_TEXTENCODING_UTF8).getStr(), !xComponent.is());
-            }
-        }
-        verify();
-        finish();
-    }
-};
-
 CPPUNIT_TEST_FIXTURE(Test, testImageHyperlink)
 {
     load(mpTestDocumentPath, "image-hyperlink.docx");
@@ -114,8 +85,10 @@ CPPUNIT_TEST_FIXTURE(Test, testImageHyperlink)
     CPPUNIT_ASSERT_EQUAL(OUString("http://www.libreoffice.org/";), URL);
 }
 
-DECLARE_SW_IMPORT_TEST(testMathMalformedXml, "math-malformed_xml.docx", 
nullptr, FailTest)
+CPPUNIT_TEST_FIXTURE(Test, testMathMalformedXml)
 {
+    OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + 
"math-malformed_xml.docx";
+    mxComponent = mxDesktop->loadComponentFromURL(aURL, "_default", 0, {});
     CPPUNIT_ASSERT(!mxComponent.is());
 }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to