[Libreoffice-commits] core.git: sc/qa

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Sun Sep 13 07:13:21 UTC 2020


 sc/qa/unit/ucalc.hxx         |    2 ++
 sc/qa/unit/ucalc_formula.cxx |   16 ++++++++++++++++
 2 files changed, 18 insertions(+)

New commits:
commit a4a6594b6475ef2e397852862ec120e33350b352
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Sat Sep 12 21:05:42 2020 +0200
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Sun Sep 13 09:12:47 2020 +0200

    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 at libreoffice.org>

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"));


More information about the Libreoffice-commits mailing list