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

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Tue May 5 15:54:06 UTC 2020


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

New commits:
commit 823a224843ee78a33f2d346c02344a88a77b2758
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Tue May 5 15:26:49 2020 +0200
Commit:     Xisco Faulí <xiscofauli at libreoffice.org>
CommitDate: Tue May 5 17:53:30 2020 +0200

    tdf#132187: sw: Add unittest
    
    Change-Id: I767f96fd8d373df9b8cbecd9cb75ed114166d0f8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93485
    Tested-by: Jenkins
    Reviewed-by: Xisco Faulí <xiscofauli at libreoffice.org>

diff --git a/sw/qa/extras/uiwriter/data3/tdf132187.odt b/sw/qa/extras/uiwriter/data3/tdf132187.odt
new file mode 100644
index 000000000000..27bea84b6584
Binary files /dev/null and b/sw/qa/extras/uiwriter/data3/tdf132187.odt differ
diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx
index 362a0161751d..4d7a43aed5b6 100644
--- a/sw/qa/extras/uiwriter/uiwriter3.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter3.cxx
@@ -77,6 +77,31 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf126626)
     CPPUNIT_ASSERT_EQUAL(sal_Int32(4), xDraws->getCount());
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf132187)
+{
+    load(DATA_DIRECTORY, "tdf132187.odt");
+
+    SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+    CPPUNIT_ASSERT(pTextDoc);
+
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
+    dispatchCommand(mxComponent, ".uno:SelectAll", {});
+    dispatchCommand(mxComponent, ".uno:Copy", {});
+    dispatchCommand(mxComponent, ".uno:GoToEndOfDoc", {});
+
+    for (sal_Int32 i = 0; i < 10; ++i)
+    {
+        dispatchCommand(mxComponent, ".uno:Paste", {});
+        Scheduler::ProcessEventsToIdle();
+    }
+
+    //without the fix in place, this test would fail with:
+    //- Expected: 1
+    //- Actual  : 70
+
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
+}
+
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf128739)
 {
     load(DATA_DIRECTORY, "tdf128739.docx");


More information about the Libreoffice-commits mailing list