diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-02-27 11:41:24 +0100 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-02-27 13:01:43 +0100 |
commit | fe01d8561339420bdbf8d98a8fd2b0fca78b6707 (patch) | |
tree | 9edd56559999818168cd5e90906ba1c90bd0749a | |
parent | ddf96414896fd19b2ed82f9e4d4974855cf1e83a (diff) |
tdf#129382: Add unittest
Change-Id: If22d82d506c365ae956de3d15e64c7065ad6b585
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89625
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | sw/CppunitTest_sw_uiwriter.mk | 1 | ||||
-rw-r--r-- | sw/qa/extras/uiwriter/data3/tdf129382.docx | bin | 0 -> 112383 bytes | |||
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter3.cxx | 36 |
3 files changed, 37 insertions, 0 deletions
diff --git a/sw/CppunitTest_sw_uiwriter.mk b/sw/CppunitTest_sw_uiwriter.mk index 342d8e3d4517..85ea9337c1d4 100644 --- a/sw/CppunitTest_sw_uiwriter.mk +++ b/sw/CppunitTest_sw_uiwriter.mk @@ -16,6 +16,7 @@ $(eval $(call gb_CppunitTest_use_common_precompiled_header,sw_uiwriter)) $(eval $(call gb_CppunitTest_add_exception_objects,sw_uiwriter, \ sw/qa/extras/uiwriter/uiwriter \ sw/qa/extras/uiwriter/uiwriter2 \ + sw/qa/extras/uiwriter/uiwriter3 \ )) # note: this links msword only for the reason to have an order dependency, diff --git a/sw/qa/extras/uiwriter/data3/tdf129382.docx b/sw/qa/extras/uiwriter/data3/tdf129382.docx Binary files differnew file mode 100644 index 000000000000..19da7ef530b7 --- /dev/null +++ b/sw/qa/extras/uiwriter/data3/tdf129382.docx diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx new file mode 100644 index 000000000000..1d6e351b614a --- /dev/null +++ b/sw/qa/extras/uiwriter/uiwriter3.cxx @@ -0,0 +1,36 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include <swmodeltestbase.hxx> + +namespace +{ +char const DATA_DIRECTORY[] = "/sw/qa/extras/uiwriter/data3/"; +} // namespace + +/// Third set of tests asserting the behavior of Writer user interface shells. +class SwUiWriterTest3 : public SwModelTestBase +{ +}; + +CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf129382) +{ + load(DATA_DIRECTORY, "tdf129382.docx"); + + SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get()); + CPPUNIT_ASSERT(pTextDoc); + + dispatchCommand(mxComponent, ".uno:SelectAll", {}); + dispatchCommand(mxComponent, ".uno:Cut", {}); + dispatchCommand(mxComponent, ".uno:Paste", {}); + dispatchCommand(mxComponent, ".uno:Undo", {}); + // without the fix, it crashes + dispatchCommand(mxComponent, ".uno:Undo", {}); +} +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |