summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2020-09-12 21:05:42 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2020-09-13 09:12:47 +0200
commita4a6594b6475ef2e397852862ec120e33350b352 (patch)
treef1a941c4977f53f3cd556f8c979b49a2a5acba29
parent61c0252f1243a249f858ae0337eeadfdbad6e1b5 (diff)
tdf#107459: sc_ucalc: Add unittest
Change-Id: I2af31d0ba6a19487ea15f4917749a5e29db6ffcc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102538 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r--sc/qa/unit/ucalc.hxx2
-rw-r--r--sc/qa/unit/ucalc_formula.cxx16
2 files changed, 18 insertions, 0 deletions
diff --git a/sc/qa/unit/ucalc.hxx b/sc/qa/unit/ucalc.hxx
index 0f07a8fd32b8..676fa52ab8d2 100644
--- a/sc/qa/unit/ucalc.hxx
+++ b/sc/qa/unit/ucalc.hxx
@@ -565,6 +565,7 @@ public:
void testTdf97369();
void testTdf97587();
+ void testTdf107459();
void testEmptyCalcDocDefaults();
@@ -872,6 +873,7 @@ public:
CPPUNIT_TEST(testMultipleDataCellsInRange);
CPPUNIT_TEST(testTdf97369);
CPPUNIT_TEST(testTdf97587);
+ CPPUNIT_TEST(testTdf107459);
CPPUNIT_TEST(testEmptyCalcDocDefaults);
CPPUNIT_TEST(testPrecisionAsShown);
CPPUNIT_TEST(testProtectedSheetEditByRow);
diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx
index 7e6e2981aba1..17af3994f141 100644
--- a/sc/qa/unit/ucalc_formula.cxx
+++ b/sc/qa/unit/ucalc_formula.cxx
@@ -8504,6 +8504,22 @@ void Test::testTdf97587()
m_pDoc->DeleteTab(0);
}
+void Test::testTdf107459()
+{
+ CPPUNIT_ASSERT(m_pDoc->InsertTab (0, "Test"));
+
+ ScAddress aPos(0,0,0);
+ m_pDoc->SetString(aPos,
+ "=MATCH(5;{20;19;18;17;16;15;14;13;12;11;10;6;6;5;5;4;4;3;2;1};-1)");
+
+ // Without the fix in place, this would have failed with
+ // - Expected: 15
+ // - Actual : 14
+ CPPUNIT_ASSERT_EQUAL(15.0, m_pDoc->GetValue(aPos));
+
+ m_pDoc->DeleteTab(0);
+}
+
void Test::testMatConcat()
{
CPPUNIT_ASSERT(m_pDoc->InsertTab (0, "Test"));