diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-01-24 20:49:08 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-01-24 23:20:51 +0100 |
commit | 3ed01498d10b0eca08453eb29fcc2c59c33d2467 (patch) | |
tree | e84cb2a55a7aaa8e70eb3ee9e7ffab4f7e421e78 | |
parent | 687cfd51ac785c2ab2cb8e49dea28aa7f53cbdfb (diff) |
tdf#139843: sw_uiwriter3: Add unittest
Change-Id: I51b1ef4a9a4af07ddcf68e4a6a4e5ea0d039bef7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128885
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r-- | sw/qa/extras/uiwriter/data/tdf139843.odt | bin | 0 -> 38984 bytes | |||
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter3.cxx | 21 |
2 files changed, 21 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/data/tdf139843.odt b/sw/qa/extras/uiwriter/data/tdf139843.odt Binary files differnew file mode 100644 index 000000000000..67a555799006 --- /dev/null +++ b/sw/qa/extras/uiwriter/data/tdf139843.odt diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx index 8ad4a66cb4e3..642dec7b812a 100644 --- a/sw/qa/extras/uiwriter/uiwriter3.cxx +++ b/sw/qa/extras/uiwriter/uiwriter3.cxx @@ -83,6 +83,27 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf145731) CPPUNIT_ASSERT_EQUAL(1, getPages()); } +CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf139843) +{ + createSwDoc(DATA_DIRECTORY, "tdf139843.odt"); + + CPPUNIT_ASSERT_EQUAL(7, getPages()); + + dispatchCommand(mxComponent, ".uno:SelectAll", {}); + Scheduler::ProcessEventsToIdle(); + + dispatchCommand(mxComponent, ".uno:Cut", {}); + Scheduler::ProcessEventsToIdle(); + + 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(7, getPages()); +} + CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf145321) { createSwDoc(DATA_DIRECTORY, "tdf145321.odt"); |