summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2020-04-06 14:15:53 +0200
committerXisco Faulí <xiscofauli@libreoffice.org>2020-04-07 12:24:41 +0200
commit9977fbeed1461a8f5cfa8029c02e914c099f3230 (patch)
treed38025afe4e6a57028d2a199f74027d7a997edfe /sw/qa
parented7a51ea8b319bc3c1dc03b7552817eeae3c1c75 (diff)
tdf#130685: Add unittest
Change-Id: I9f0b9a7129056ff3447e1cf91d4eaf188180a04c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91747 Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/uiwriter/data3/tdf130685.odtbin0 -> 24714 bytes
-rw-r--r--sw/qa/extras/uiwriter/uiwriter3.cxx32
2 files changed, 31 insertions, 1 deletions
diff --git a/sw/qa/extras/uiwriter/data3/tdf130685.odt b/sw/qa/extras/uiwriter/data3/tdf130685.odt
new file mode 100644
index 000000000000..f83827ebb7e4
--- /dev/null
+++ b/sw/qa/extras/uiwriter/data3/tdf130685.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx
index 7b35f1a85c83..2bafcd233e8f 100644
--- a/sw/qa/extras/uiwriter/uiwriter3.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter3.cxx
@@ -318,6 +318,36 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf130746)
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount());
}
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf130685)
+{
+ load(DATA_DIRECTORY, "tdf130685.odt");
+
+ SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+ CPPUNIT_ASSERT(pTextDoc);
+
+ CPPUNIT_ASSERT_EQUAL(2, getPages());
+ dispatchCommand(mxComponent, ".uno:SelectAll", {});
+ dispatchCommand(mxComponent, ".uno:Cut", {});
+ Scheduler::ProcessEventsToIdle();
+ CPPUNIT_ASSERT_EQUAL(1, getPages());
+
+ dispatchCommand(mxComponent, ".uno:Paste", {});
+ dispatchCommand(mxComponent, ".uno:Paste", {});
+
+ // Without fix in place, this test would have failed with:
+ //- Expected: 2
+ //- Actual : 4
+ CPPUNIT_ASSERT_EQUAL(2, getPages());
+
+ dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, ".uno:Undo", {});
+ CPPUNIT_ASSERT_EQUAL(1, getPages());
+
+ //FIXME: See tdf#131147
+ //dispatchCommand(mxComponent, ".uno:Undo", {});
+ //CPPUNIT_ASSERT_EQUAL(2, getPages());
+}
+
CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf130680)
{
load(DATA_DIRECTORY, "tdf130680.odt");
@@ -337,7 +367,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf130680)
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), xIndexAccess->getCount());
dispatchCommand(mxComponent, ".uno:Paste", {});
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount());
- //FIXME: See https://bugs.documentfoundation.org/show_bug.cgi?id=130680#c5
+ //FIXME: See tdf#131147
//dispatchCommand(mxComponent, ".uno:Undo", {});
//CPPUNIT_ASSERT_EQUAL(sal_Int32(0), xIndexAccess->getCount());
//dispatchCommand(mxComponent, ".uno:Undo", {});