summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2020-06-28 19:21:44 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2020-06-28 20:32:04 +0200
commit263dedd5f6c242045174a3be21a16212f65408de (patch)
tree90bc5c91af5cd6d3e1ab6f09770536d44d134304
parent9eb3aabbf497dba2093f4394645bad3079286cf0 (diff)
tdf#98844: sc: Add unittest
Change-Id: I31fc5ca3778048010e34dafd289e0cadf7ee4169 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97347 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r--sc/qa/unit/data/ods/tdf98844.odsbin0 -> 9221 bytes
-rw-r--r--sc/qa/unit/subsequent_filters-test.cxx21
2 files changed, 21 insertions, 0 deletions
diff --git a/sc/qa/unit/data/ods/tdf98844.ods b/sc/qa/unit/data/ods/tdf98844.ods
new file mode 100644
index 000000000000..1e072b7c65e0
--- /dev/null
+++ b/sc/qa/unit/data/ods/tdf98844.ods
Binary files differ
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 0cb013df3bda..71d0d22ea069 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -226,6 +226,7 @@ public:
void testBnc762542();
void testTdf103734();
+ void testTdf98844();
void testTdf100458();
void testTdf127982();
void testTdf100709XLSX();
@@ -382,6 +383,7 @@ public:
CPPUNIT_TEST(testHiddenSheetsXLSX);
CPPUNIT_TEST(testTdf103734);
+ CPPUNIT_TEST(testTdf98844);
CPPUNIT_TEST(testTdf100458);
CPPUNIT_TEST(testTdf127982);
CPPUNIT_TEST(testTdf100709XLSX);
@@ -3744,6 +3746,25 @@ void ScFiltersTest::testTdf103734()
xDocSh->DoClose();
}
+void ScFiltersTest::testTdf98844()
+{
+ ScDocShellRef xDocSh = loadDoc("tdf98844.", FORMAT_ODS);
+ CPPUNIT_ASSERT_MESSAGE("Failed to open doc", xDocSh.is());
+ ScDocument& rDoc = xDocSh->GetDocument();
+
+ CPPUNIT_ASSERT_EQUAL(47.6227, rDoc.GetValue(ScAddress(0,7,0)));
+ CPPUNIT_ASSERT_EQUAL(48.0, rDoc.GetValue(ScAddress(0,8,0)));
+
+ xDocSh->DoHardRecalc();
+
+ // Without the fix in place, SUM() wouldn't have been updated when
+ // Precision as shown is enabled
+ CPPUNIT_ASSERT_EQUAL(48.0, rDoc.GetValue(ScAddress(0,7,0)));
+ CPPUNIT_ASSERT_EQUAL(48.0, rDoc.GetValue(ScAddress(0,8,0)));
+
+ xDocSh->DoClose();
+}
+
void ScFiltersTest::testTdf100458()
{
ScDocShellRef xDocSh = loadDoc("tdf100458_lost_zero_value.", FORMAT_ODS);