summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2021-08-11 20:42:17 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2021-08-12 00:20:50 +0200
commit3c0c1b79b689775f09b3bff75bb01118b380f41f (patch)
tree4fc49a36309cc6e4a53d257ecc7b31639dbadb0f
parentb37fd7f38165dadc5b1a674b73f4b18824e4789e (diff)
tdf#76310: subsequent_filters: Add unittest
Change-Id: If39bb4e3c7e767f273351cb381ea055e3934de2d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120338 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r--sc/qa/unit/data/ods/tdf76310.odsbin0 -> 1994 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/tdf76310.ods b/sc/qa/unit/data/ods/tdf76310.ods
new file mode 100644
index 000000000000..219437acfe29
--- /dev/null
+++ b/sc/qa/unit/data/ods/tdf76310.ods
Binary files differ
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 75ff20e23034..b48e9a2df575 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -115,6 +115,7 @@ public:
void testUpdateCircleInMergedCellODS();
void testDeleteCircleInMergedCellODS();
void testBooleanFormatXLSX();
+ void testTdf76310();
void testBasicCellContentODS();
void testRangeNameXLS();
void testRangeNameLocalXLS();
@@ -224,6 +225,7 @@ public:
CPPUNIT_TEST(testUpdateCircleInMergedCellODS);
CPPUNIT_TEST(testDeleteCircleInMergedCellODS);
CPPUNIT_TEST(testBooleanFormatXLSX);
+ CPPUNIT_TEST(testTdf76310);
CPPUNIT_TEST(testBasicCellContentODS);
CPPUNIT_TEST(testRangeNameXLS);
CPPUNIT_TEST(testRangeNameLocalXLS);
@@ -671,6 +673,25 @@ void ScFiltersTest::testBooleanFormatXLSX()
xDocSh->DoClose();
}
+void ScFiltersTest::testTdf76310()
+{
+ ScDocShellRef xDocSh = loadDoc(u"tdf76310.", FORMAT_ODS);
+
+ ScDocument& rDoc = xDocSh->GetDocument();
+
+ OUString aFormula;
+ rDoc.GetFormula(0, 0, 0, aFormula);
+ // Without the fix in place, this test would have failed with
+ // - Expected: =1
+ // +
+ // 2
+ // - Actual : =1 + 2
+ CPPUNIT_ASSERT_EQUAL(OUString("=1\n+\n2"), aFormula);
+ ASSERT_DOUBLES_EQUAL(3.0, rDoc.GetValue(0, 0, 0));
+
+ xDocSh->DoClose();
+}
+
void ScFiltersTest::testRangeNameXLS()
{
ScDocShellRef xDocSh = loadDoc(u"named-ranges-global.", FORMAT_XLS);