diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-03-22 12:58:37 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-03-22 13:45:08 +0100 |
commit | 215cbf1ad23399cb035781698aa28d1eabdb6489 (patch) | |
tree | dc1f286058659591379be379f9ac5367192fd74f /sc | |
parent | e0b281b17b974d20f98a61804377cfae07753016 (diff) |
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 <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/unit/ucalc.cxx | 19 |
1 files changed, 19 insertions, 0 deletions
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")); |