[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/qa

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Thu Jul 30 11:31:42 UTC 2020


 sw/qa/extras/uiwriter/data3/tdf133967.odt |binary
 sw/qa/extras/uiwriter/uiwriter3.cxx       |   28 ++++++++++++++++++++++++++++
 2 files changed, 28 insertions(+)

New commits:
commit a77ad868f12038a28634fb110fc5e77390d5584e
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Thu Jul 30 01:28:14 2020 +0200
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Thu Jul 30 13:31:08 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

diff --git a/sw/qa/extras/uiwriter/data3/tdf133967.odt b/sw/qa/extras/uiwriter/data3/tdf133967.odt
new file mode 100644
index 000000000000..18ed5bfb7844
Binary files /dev/null and b/sw/qa/extras/uiwriter/data3/tdf133967.odt differ
diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx
index 4196840ebfe5..342c44146936 100644
--- a/sw/qa/extras/uiwriter/uiwriter3.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter3.cxx
@@ -78,6 +78,34 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf126626)
     CPPUNIT_ASSERT_EQUAL(4, getShapes());
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf133967)
+{
+    load(DATA_DIRECTORY, "tdf133967.odt");
+
+    SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+    CPPUNIT_ASSERT(pTextDoc);
+    CPPUNIT_ASSERT_EQUAL(6, getPages());
+
+    dispatchCommand(mxComponent, ".uno:SelectAll", {});
+
+    dispatchCommand(mxComponent, ".uno:Cut", {});
+    Scheduler::ProcessEventsToIdle();
+
+    for (sal_Int32 i = 0; i < 10; ++i)
+    {
+        dispatchCommand(mxComponent, ".uno:Undo", {});
+        Scheduler::ProcessEventsToIdle();
+
+        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());
+}
+
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf132187)
 {
     load(DATA_DIRECTORY, "tdf132187.odt");


More information about the Libreoffice-commits mailing list