[Libreoffice-commits] core.git: sw/qa

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Mon Jun 14 20:51:59 UTC 2021


 sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx |   14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

New commits:
commit 28fb60fe9094f9f88c196dad8429258c38e660ad
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Mon Jun 14 20:39:36 2021 +0200
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Mon Jun 14 22:51:17 2021 +0200

    sw_core_accessibilitycheck: remove duplicated createDoc method
    
    Change-Id: Icdd1cded776544b5d2f4b7c3335f235aca490726
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117187
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx b/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx
index bc3446f30514..2545171d6c38 100644
--- a/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx
+++ b/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx
@@ -12,21 +12,15 @@
 #include <unotxdoc.hxx>
 #include <docsh.hxx>
 
+constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/core/accessibilitycheck/data/";
+
 class AccessibilityCheckTest : public SwModelTestBase
 {
-public:
-    SwDoc* createDoc(const char* pName = nullptr)
-    {
-        load(u"/sw/qa/core/accessibilitycheck/data/", pName);
-        SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
-        CPPUNIT_ASSERT(pTextDoc);
-        return pTextDoc->GetDocShell()->GetDoc();
-    }
 };
 
 CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, testCheckDocumentIssues)
 {
-    SwDoc* pDoc = createDoc("DocumentTest.odt");
+    SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "DocumentTest.odt");
     CPPUNIT_ASSERT(pDoc);
     sw::AccessibilityCheck aCheck(pDoc);
     aCheck.check();
@@ -38,7 +32,7 @@ CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, testCheckDocumentIssues)
 
 CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, testTableSplitMergeAndAltText)
 {
-    SwDoc* pDoc = createDoc("AccessibilityTests1.odt");
+    SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "AccessibilityTests1.odt");
     CPPUNIT_ASSERT(pDoc);
     sw::AccessibilityCheck aCheck(pDoc);
     aCheck.check();


More information about the Libreoffice-commits mailing list