sw/qa/extras/uiwriter/data3/tdf133967.odt |binary sw/qa/extras/uiwriter/uiwriter3.cxx | 28 ++++++++++++++++++++++++++++ 2 files changed, 28 insertions(+)
New commits: commit a6e02f6337f038a445b858bb91bf14d1a14768e4 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Thu Jul 30 01:28:14 2020 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Thu Jul 30 10:35:06 2020 +0200 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 <xiscofa...@libreoffice.org> diff --git a/sw/qa/extras/uiwriter/data3/tdf133967.odt b/sw/qa/extras/uiwriter/data3/tdf133967.odt new file mode 100644 index 000000000000..18ed5bfb7844 Binary files /dev/null and b/sw/qa/extras/uiwriter/data3/tdf133967.odt differ 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"); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits