diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-10-14 13:37:56 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-10-14 16:03:24 +0200 |
commit | dd78ef9ff26fa35a03ac655b0d96738170e8e08b (patch) | |
tree | 3f411af0a68ddc7f60bbaa221a4b22908f0f297b /sc | |
parent | fde7bb6ddc9c2f9b515e1b3aac791635bcf813fa (diff) |
tdf#133260: sc_ucalc: Add unittest
Change-Id: I4661057a3e65f0e5ab7b18d8ad44bcd08a659039
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104281
Tested-by: Jenkins
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/unit/ucalc.hxx | 2 | ||||
-rw-r--r-- | sc/qa/unit/ucalc_formula.cxx | 19 |
2 files changed, 21 insertions, 0 deletions
diff --git a/sc/qa/unit/ucalc.hxx b/sc/qa/unit/ucalc.hxx index 676fa52ab8d2..de29194c2887 100644 --- a/sc/qa/unit/ucalc.hxx +++ b/sc/qa/unit/ucalc.hxx @@ -566,6 +566,7 @@ public: void testTdf97369(); void testTdf97587(); void testTdf107459(); + void testTdf133260(); void testEmptyCalcDocDefaults(); @@ -874,6 +875,7 @@ public: CPPUNIT_TEST(testTdf97369); CPPUNIT_TEST(testTdf97587); CPPUNIT_TEST(testTdf107459); + CPPUNIT_TEST(testTdf133260); 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 fd652222bffa..83fbd63ec247 100644 --- a/sc/qa/unit/ucalc_formula.cxx +++ b/sc/qa/unit/ucalc_formula.cxx @@ -8520,6 +8520,25 @@ void Test::testTdf107459() m_pDoc->DeleteTab(0); } +void Test::testTdf133260() +{ + CPPUNIT_ASSERT(m_pDoc->InsertTab (0, "Test")); + + ScAddress aPos1(0,0,0); + m_pDoc->SetString(aPos1, "=SUM(ABS(MUNIT(2)))"); + + ScAddress aPos2(0,1,0); + m_pDoc->SetString(aPos2, "=SUM(ABS(MUNIT(2)*-1))"); + + // Without the fix in place, this test would have failed with + // - Expected: 2 + // - Actual : 1 + CPPUNIT_ASSERT_EQUAL(2.0, m_pDoc->GetValue(aPos1)); + CPPUNIT_ASSERT_EQUAL(2.0, m_pDoc->GetValue(aPos2)); + + m_pDoc->DeleteTab(0); +} + void Test::testMatConcat() { CPPUNIT_ASSERT(m_pDoc->InsertTab (0, "Test")); |