[Libreoffice-commits] core.git: sc/qa
Xisco Fauli (via logerrit)
logerrit at kemper.freedesktop.org
Wed Sep 9 19:19:30 UTC 2020
sc/qa/unit/data/xlsx/tdf136364.xlsx |binary
sc/qa/unit/subsequent_filters-test.cxx | 26 ++++++++++++++++++++++++++
2 files changed, 26 insertions(+)
New commits:
commit 4a6fedc2e21d7036ae784ed90e78e3eb2fe1b3d5
Author: Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Wed Sep 9 17:05:47 2020 +0200
Commit: Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Wed Sep 9 21:18:52 2020 +0200
tdf#136364: sc_subsequent_filters_test: Add unittest
Change-Id: I4088e6e3f0b4c344011c1cee589e2fa0b504e3ca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102326
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
diff --git a/sc/qa/unit/data/xlsx/tdf136364.xlsx b/sc/qa/unit/data/xlsx/tdf136364.xlsx
new file mode 100644
index 000000000000..45358a6b1ebd
Binary files /dev/null and b/sc/qa/unit/data/xlsx/tdf136364.xlsx differ
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 7ca0f5fa1a25..bc8c36a9bf9c 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -227,6 +227,7 @@ public:
void testBnc762542();
+ void testTdf136364();
void testTdf103734();
void testTdf98844();
void testTdf100458();
@@ -395,6 +396,7 @@ public:
CPPUNIT_TEST(testHiddenSheetsXLSX);
+ CPPUNIT_TEST(testTdf136364);
CPPUNIT_TEST(testTdf103734);
CPPUNIT_TEST(testTdf98844);
CPPUNIT_TEST(testTdf100458);
@@ -3786,6 +3788,30 @@ void ScFiltersTest::testRelFormulaValidationXLS()
xDocSh->DoClose();
}
+void ScFiltersTest::testTdf136364()
+{
+ ScDocShellRef xDocSh = loadDoc("tdf136364.", FORMAT_XLSX);
+ CPPUNIT_ASSERT_MESSAGE("Failed to open doc", xDocSh.is());
+
+ ScDocument& rDoc = xDocSh->GetDocument();
+
+ // Without the fix in place, it would have failed with
+ // - Expected: =SUM((B2:B3~C4:C5~D6:D7))
+ // - Actual : =SUM((B2:B3~C4:C5,D6:D7))
+ OUString aFormula;
+ rDoc.GetFormula(4, 0, 0, aFormula);
+ CPPUNIT_ASSERT_EQUAL(OUString("=SUM((B2:B3~C4:C5~D6:D7))"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(27.0, rDoc.GetValue(ScAddress(4,0,0)));
+
+ // - Expected: =SUM((B2~C4~D6))
+ // - Actual : =SUM((B2~C4,D6))
+ rDoc.GetFormula(4, 1, 0, aFormula);
+ CPPUNIT_ASSERT_EQUAL(OUString("=SUM((B2~C4~D6))"), aFormula);
+ CPPUNIT_ASSERT_EQUAL(12.0, rDoc.GetValue(ScAddress(4,1,0)));
+
+ xDocSh->DoClose();
+}
+
void ScFiltersTest::testTdf103734()
{
ScDocShellRef xDocSh = loadDoc("tdf103734.", FORMAT_ODS);
More information about the Libreoffice-commits
mailing list