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

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Thu Dec 10 20:29:21 UTC 2020


 sw/qa/extras/uiwriter/uiwriter.cxx |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

New commits:
commit 7cef2f69f8553380e77ab0efab4018a010e3d9cd
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Thu Dec 10 17:37:32 2020 +0100
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Thu Dec 10 21:28:37 2020 +0100

    tdf#81226: sw_uiwriter: Add unittest
    
    Change-Id: If5f6ae5822b7af9618b447dc60180ffe3f9f04b1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107569
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index b699c2cd10ae..461b971afaf8 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -213,6 +213,7 @@ public:
     void testCreatePortions();
     void testBookmarkUndo();
     void testFdo85876();
+    void testTdf81226();
     void testTdf79717();
     void testTdf137532();
     void testFdo87448();
@@ -444,6 +445,7 @@ public:
     CPPUNIT_TEST(testCreatePortions);
     CPPUNIT_TEST(testBookmarkUndo);
     CPPUNIT_TEST(testFdo85876);
+    CPPUNIT_TEST(testTdf81226);
     CPPUNIT_TEST(testTdf79717);
     CPPUNIT_TEST(testTdf137532);
     CPPUNIT_TEST(testFdo87448);
@@ -2021,6 +2023,21 @@ void SwUiWriterTest::testFdo85876()
     }
 }
 
+void SwUiWriterTest::testTdf81226()
+{
+    SwDoc* const pDoc = createDoc();
+    SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+    pWrtShell->Insert("before");
+    pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 4, /*bBasicCall=*/false);
+    pWrtShell->Down(false);
+    pWrtShell->Insert("after");
+
+    // Without the fix in place, this test would have failed with
+    // - Expected: beforeafter
+    // - Actual  : beafterfore
+    CPPUNIT_ASSERT_EQUAL(OUString("beforeafter"), getParagraph(1)->getString());
+}
+
 void SwUiWriterTest::testTdf79717()
 {
     SwDoc* const pDoc = createDoc();


More information about the Libreoffice-commits mailing list