[Libreoffice-commits] core.git: sc/qa
Xisco Fauli (via logerrit)
logerrit at kemper.freedesktop.org
Thu Mar 25 23:55:14 UTC 2021
sc/qa/unit/uicalc/data/tdf112884.ods |binary
sc/qa/unit/uicalc/uicalc.cxx | 24 ++++++++++++++++++++++++
2 files changed, 24 insertions(+)
New commits:
commit 3e7e6f6fc7f8f03c6ba329c547749e3f3746c2a0
Author: Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Thu Mar 25 23:38:25 2021 +0100
Commit: Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Fri Mar 26 00:54:36 2021 +0100
tdf#112884: sc_uicalc: Add unittest
Change-Id: I05802b13cc09b559559206e6a76ce523bea96d61
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113110
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
diff --git a/sc/qa/unit/uicalc/data/tdf112884.ods b/sc/qa/unit/uicalc/data/tdf112884.ods
new file mode 100644
index 000000000000..a39a1789ef21
Binary files /dev/null and b/sc/qa/unit/uicalc/data/tdf112884.ods differ
diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx
index e3f1d2e14496..b0281d66cf62 100644
--- a/sc/qa/unit/uicalc/uicalc.cxx
+++ b/sc/qa/unit/uicalc/uicalc.cxx
@@ -1111,6 +1111,30 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf112735)
CPPUNIT_ASSERT_EQUAL(OUString("(empty)"), pDoc->GetString(ScAddress(1, 0, 0)));
}
+CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf112884)
+{
+ ScModelObj* pModelObj = createDoc("tdf112884.ods");
+ ScDocument* pDoc = pModelObj->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+
+ CPPUNIT_ASSERT_EQUAL(OUString("0.5"), pDoc->GetString(ScAddress(6, 2, 0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("0.666666666666667"), pDoc->GetString(ScAddress(6, 3, 0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("0.833333333333333"), pDoc->GetString(ScAddress(6, 4, 0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("#DIV/0!"), pDoc->GetString(ScAddress(6, 5, 0)));
+
+ goToCell("G3");
+
+ dispatchCommand(mxComponent, ".uno:RecalcPivotTable", {});
+
+ // Without the fix in place, this test would haved failed with
+ // - Expected: #DIV/0!
+ // - Actual : 0.5
+ CPPUNIT_ASSERT_EQUAL(OUString("#DIV/0!"), pDoc->GetString(ScAddress(6, 2, 0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("0.5"), pDoc->GetString(ScAddress(6, 3, 0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("0.666666666666667"), pDoc->GetString(ScAddress(6, 4, 0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("0.833333333333333"), pDoc->GetString(ScAddress(6, 5, 0)));
+}
+
CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf133342)
{
ScModelObj* pModelObj = createDoc("tdf133342.ods");
More information about the Libreoffice-commits
mailing list