diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-11-18 12:35:48 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-11-18 16:38:02 +0100 |
commit | 23ad6c5d98e47310703de69506afe89883a75818 (patch) | |
tree | 7da1761178c866744b69bf59f70011fce39d1337 | |
parent | 16031da61bdd7cc9b29e47bf98c6e411175afc7f (diff) |
tdf#145731: sw_uiwriter3: Add unittest
Change-Id: Id605ebee7145eaeb9ec5a533b7e72a0378d6bb7a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125470
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r-- | sw/qa/extras/uiwriter/data/tdf145731.odt | bin | 0 -> 11459 bytes | |||
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter3.cxx | 24 |
2 files changed, 24 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/data/tdf145731.odt b/sw/qa/extras/uiwriter/data/tdf145731.odt Binary files differnew file mode 100644 index 000000000000..312de88c598c --- /dev/null +++ b/sw/qa/extras/uiwriter/data/tdf145731.odt diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx index 23e8113f63dc..c86fb182c07e 100644 --- a/sw/qa/extras/uiwriter/uiwriter3.cxx +++ b/sw/qa/extras/uiwriter/uiwriter3.cxx @@ -58,6 +58,30 @@ class SwUiWriterTest3 : public SwModelTestBase { }; +CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf145731) +{ + createSwDoc(DATA_DIRECTORY, "tdf145731.odt"); + + CPPUNIT_ASSERT_EQUAL(9, getShapes()); + CPPUNIT_ASSERT_EQUAL(1, getPages()); + + dispatchCommand(mxComponent, ".uno:SelectAll", {}); + Scheduler::ProcessEventsToIdle(); + + dispatchCommand(mxComponent, ".uno:Cut", {}); + Scheduler::ProcessEventsToIdle(); + + CPPUNIT_ASSERT_EQUAL(0, getShapes()); + CPPUNIT_ASSERT_EQUAL(1, getPages()); + + // Without the fix in place, this test would have crashed here + dispatchCommand(mxComponent, ".uno:Paste", {}); + Scheduler::ProcessEventsToIdle(); + + CPPUNIT_ASSERT_EQUAL(9, getShapes()); + CPPUNIT_ASSERT_EQUAL(1, getPages()); +} + CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf129382) { SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf129382.docx"); |