diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-07-30 01:28:14 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-07-30 10:35:06 +0200 |
commit | a6e02f6337f038a445b858bb91bf14d1a14768e4 (patch) | |
tree | 239beb7fdef709bec6396d8a80da0cd3e3b94ac2 | |
parent | c56175b41f51007f7531a2c1d202605c9a6bb2a6 (diff) |
tdf#133967: sw_uiwriter: Add unittest
Change-Id: I7ec43fd7109e883b0ae560cc8832e449a09fddb0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99758
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r-- | sw/qa/extras/uiwriter/data3/tdf133967.odt | bin | 0 -> 16689 bytes | |||
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter3.cxx | 28 |
2 files changed, 28 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/data3/tdf133967.odt b/sw/qa/extras/uiwriter/data3/tdf133967.odt Binary files differnew file mode 100644 index 000000000000..18ed5bfb7844 --- /dev/null +++ b/sw/qa/extras/uiwriter/data3/tdf133967.odt diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx index 4ce713e82b8d..47bfca6c5451 100644 --- a/sw/qa/extras/uiwriter/uiwriter3.cxx +++ b/sw/qa/extras/uiwriter/uiwriter3.cxx @@ -199,6 +199,34 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf126626) CPPUNIT_ASSERT_EQUAL(4, getShapes()); } +CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf133967) +{ + load(DATA_DIRECTORY, "tdf133967.odt"); + + SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get()); + CPPUNIT_ASSERT(pTextDoc); + CPPUNIT_ASSERT_EQUAL(6, getPages()); + + dispatchCommand(mxComponent, ".uno:SelectAll", {}); + + dispatchCommand(mxComponent, ".uno:Cut", {}); + Scheduler::ProcessEventsToIdle(); + + for (sal_Int32 i = 0; i < 10; ++i) + { + dispatchCommand(mxComponent, ".uno:Undo", {}); + Scheduler::ProcessEventsToIdle(); + + dispatchCommand(mxComponent, ".uno:Redo", {}); + Scheduler::ProcessEventsToIdle(); + } + + // Without the fix in place, this test would have failed with: + //- Expected: 1 + //- Actual : 45 + CPPUNIT_ASSERT_EQUAL(1, getPages()); +} + CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf132187) { load(DATA_DIRECTORY, "tdf132187.odt"); |