[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - sw/qa

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Fri Jul 31 09:46:22 UTC 2020


 sw/qa/extras/uiwriter/data/tdf133967.odt |binary
 sw/qa/extras/uiwriter/uiwriter.cxx       |   30 ++++++++++++++++++++++++++++++
 2 files changed, 30 insertions(+)

New commits:
commit a6753768fe914fb110bc4e4def4699b8e54b7e49
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Thu Jul 30 01:28:14 2020 +0200
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Fri Jul 31 11:45:51 2020 +0200

    tdf#133967: sw_uiwriter: Add unittest
    
    Change-Id: I7ec43fd7109e883b0ae560cc8832e449a09fddb0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99758
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
    (cherry picked from commit a6e02f6337f038a445b858bb91bf14d1a14768e4)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99735
    Signed-off-by: Xisco Fauli <xiscofauli at libreoffice.org>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99791

diff --git a/sw/qa/extras/uiwriter/data/tdf133967.odt b/sw/qa/extras/uiwriter/data/tdf133967.odt
new file mode 100644
index 000000000000..18ed5bfb7844
Binary files /dev/null and b/sw/qa/extras/uiwriter/data/tdf133967.odt differ
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 3d7291de336b..157773a7648a 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -233,6 +233,7 @@ public:
     void testSearchWithTransliterate();
     void testTdf73660();
     void testNewDocModifiedState();
+    void testTdf133967();
     void testTdf132187();
     void testTdf77342();
     void testTdf63553();
@@ -441,6 +442,7 @@ public:
     CPPUNIT_TEST(testSearchWithTransliterate);
     CPPUNIT_TEST(testTdf73660);
     CPPUNIT_TEST(testNewDocModifiedState);
+    CPPUNIT_TEST(testTdf133967);
     CPPUNIT_TEST(testTdf132187);
     CPPUNIT_TEST(testTdf77342);
     CPPUNIT_TEST(testTdf63553);
@@ -4339,6 +4341,34 @@ void SwUiWriterTest::testUnicodeNotationToggle()
     CPPUNIT_ASSERT_EQUAL( sDocString, sOriginalDocString );
 }
 
+void SwUiWriterTest::testTdf133967()
+{
+    load(DATA_DIRECTORY, "tdf133967.odt");
+
+    SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+    CPPUNIT_ASSERT(pTextDoc);
+    CPPUNIT_ASSERT_EQUAL(6, getPages());
+
+    lcl_dispatchCommand(mxComponent, ".uno:SelectAll", {});
+
+    lcl_dispatchCommand(mxComponent, ".uno:Cut", {});
+    Scheduler::ProcessEventsToIdle();
+
+    for (sal_Int32 i = 0; i < 10; ++i)
+    {
+        lcl_dispatchCommand(mxComponent, ".uno:Undo", {});
+        Scheduler::ProcessEventsToIdle();
+
+        lcl_dispatchCommand(mxComponent, ".uno:Redo", {});
+        Scheduler::ProcessEventsToIdle();
+    }
+
+    // Without the fix in place, this test would have failed with:
+    //- Expected: 1
+    //- Actual  : 45
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
+}
+
 void SwUiWriterTest::testTdf132187()
 {
     load(DATA_DIRECTORY, "tdf132187.odt");


More information about the Libreoffice-commits mailing list