summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2021-02-08 11:15:04 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2021-02-09 12:32:32 +0100
commit593ab5fbedb3de3c62039affd69f3dcd30f56d8f (patch)
tree7adaf4a9a1a9a49cd7f944204b0d7158f6c9440f /sc
parente2342ca5155f27637770fc392916804c8ac4728f (diff)
tdf#140151: sc_uicalc: Add unittest
For some reason, this test fails on Mac and Windows. I tried different approaches but all of them failed. See https://gerrit.libreoffice.org/c/core/+/110551 Since I don't know any other way of testing this bug, let test it at least on Linux Change-Id: I40e0afe6c850533e4a1db0fec30838a66f206512 Change-Id: Ide728ad41cf3952d1acf8fd98a64b72ee7c5cda6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110624 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/unit/uicalc/data/tdf140151.odsbin0 -> 8614 bytes
-rw-r--r--sc/qa/unit/uicalc/uicalc.cxx17
2 files changed, 17 insertions, 0 deletions
diff --git a/sc/qa/unit/uicalc/data/tdf140151.ods b/sc/qa/unit/uicalc/data/tdf140151.ods
new file mode 100644
index 000000000000..6c908b7596e3
--- /dev/null
+++ b/sc/qa/unit/uicalc/data/tdf140151.ods
Binary files differ
diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx
index f1d861518271..8c92824fe541 100644
--- a/sc/qa/unit/uicalc/uicalc.cxx
+++ b/sc/qa/unit/uicalc/uicalc.cxx
@@ -281,6 +281,23 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf92963)
pMod->SetInputOptions(aInputOption);
}
+CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf140151)
+{
+#if !defined(MACOSX) && !defined(_WIN32) //FIXME
+ ScModelObj* pModelObj = createDoc("tdf140151.ods");
+ ScDocument* pDoc = pModelObj->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+
+ // Focus is already on the button
+ pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::RETURN);
+ pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::RETURN);
+ Scheduler::ProcessEventsToIdle();
+
+ // Without the fix in place, the current cursor position wouldn't have changed
+ lcl_AssertCurrentCursorPosition(1, 110);
+#endif
+}
+
CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf68290)
{
ScModelObj* pModelObj = createDoc("tdf68290.ods");