sc/qa/unit/ucalc.cxx |   19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

New commits:
commit 215cbf1ad23399cb035781698aa28d1eabdb6489
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Tue Mar 22 12:58:37 2022 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Tue Mar 22 13:45:08 2022 +0100

    tdf#114406: sc_ucalc: Add unittest
    
    Change-Id: I0d6be8945e3aaecdccfc674c70f60b6f150f3c05
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131934
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 9477fd1f10f5..895d5a96bf89 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -90,6 +90,7 @@ public:
     void testInput();
     void testColumnIterator();
     void testTdf90698();
+    void testTdf114406();
     void testTdf93951();
     void testTdf134490();
     void testTdf135249();
@@ -235,6 +236,7 @@ public:
     CPPUNIT_TEST(testInput);
     CPPUNIT_TEST(testColumnIterator);
     CPPUNIT_TEST(testTdf90698);
+    CPPUNIT_TEST(testTdf114406);
     CPPUNIT_TEST(testTdf93951);
     CPPUNIT_TEST(testTdf134490);
     CPPUNIT_TEST(testTdf135249);
@@ -675,6 +677,23 @@ void Test::testTdf90698()
     m_pDoc->DeleteTab(0);
 }
 
+void Test::testTdf114406()
+{
+    CPPUNIT_ASSERT(m_pDoc->InsertTab (0, "Test"));
+    m_pDoc->SetString(ScAddress(0,0,0), "5");
+    m_pDoc->SetString(ScAddress(1,0,0), "=A1/100%");
+
+    // Without the fix in place, this would have failed with
+    // - Expected: =A1/100%
+    // - Actual  : =A1/1
+    OUString aFormula = m_pDoc->GetFormula(1,0,0);
+    CPPUNIT_ASSERT_EQUAL(OUString("=A1/100%"), aFormula);
+
+    CPPUNIT_ASSERT_EQUAL(5.0, m_pDoc->GetValue(ScAddress(1,0,0)));
+
+    m_pDoc->DeleteTab(0);
+}
+
 void Test::testTdf93951()
 {
     CPPUNIT_ASSERT(m_pDoc->InsertTab (0, "Test"));

Reply via email to