[Libreoffice-commits] core.git: sc/qa

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Fri Apr 16 17:42:22 UTC 2021


 sc/qa/unit/data/xlsx/tdf98481.xlsx     |binary
 sc/qa/unit/subsequent_filters-test.cxx |   22 ++++++++++++++++++++++
 2 files changed, 22 insertions(+)

New commits:
commit 2f509fce90a29b7c35910b670fb79a6e2b72ba7b
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Fri Apr 16 18:44:47 2021 +0200
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Fri Apr 16 19:41:45 2021 +0200

    tdf#98481: sc_subsequent_filters: Add unittest
    
    Change-Id: Ic5c69f1280f972ff3f51353fbc9bbd7c95123a12
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114218
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/sc/qa/unit/data/xlsx/tdf98481.xlsx b/sc/qa/unit/data/xlsx/tdf98481.xlsx
new file mode 100644
index 000000000000..bc198d2fe6a4
Binary files /dev/null and b/sc/qa/unit/data/xlsx/tdf98481.xlsx differ
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 3d886c7b10fb..5bdea80d8361 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -301,6 +301,7 @@ public:
     void testTdf112780();
     void testTdf72470();
     void testTdf35636();
+    void testTdf98481();
     void testVBAMacroFunctionODS();
     void testAutoheight2Rows();
     void testXLSDefColWidth();
@@ -498,6 +499,7 @@ public:
     CPPUNIT_TEST(testTdf112780);
     CPPUNIT_TEST(testTdf72470);
     CPPUNIT_TEST(testTdf35636);
+    CPPUNIT_TEST(testTdf98481);
     CPPUNIT_TEST(testVBAMacroFunctionODS);
     CPPUNIT_TEST(testAutoheight2Rows);
     CPPUNIT_TEST(testXLSDefColWidth);
@@ -5328,6 +5330,26 @@ void ScFiltersTest::testTdf35636()
     xDocSh->DoClose();
 }
 
+void ScFiltersTest::testTdf98481()
+{
+    ScDocShellRef xDocSh = loadDoc(u"tdf98481.", FORMAT_XLSX);
+    CPPUNIT_ASSERT_MESSAGE("Failed to open doc", xDocSh.is());
+
+    ScDocument& rDoc = xDocSh->GetDocument();
+
+    // Without the fix in place, this test would have failed with
+    // - Expected: 4
+    // - Actual  : 0
+    CPPUNIT_ASSERT_EQUAL(4.0, rDoc.GetValue(ScAddress(4,1,0)));
+    CPPUNIT_ASSERT_EQUAL(0.0, rDoc.GetValue(ScAddress(4,2,0)));
+    CPPUNIT_ASSERT_EQUAL(3.0, rDoc.GetValue(ScAddress(4,3,0)));
+    CPPUNIT_ASSERT_EQUAL(4.0, rDoc.GetValue(ScAddress(1,4,0)));
+    CPPUNIT_ASSERT_EQUAL(0.0, rDoc.GetValue(ScAddress(2,4,0)));
+    CPPUNIT_ASSERT_EQUAL(3.0, rDoc.GetValue(ScAddress(3,4,0)));
+
+    xDocSh->DoClose();
+}
+
 void ScFiltersTest::testVBAMacroFunctionODS()
 {
     ScDocShellRef xDocSh = loadDoc(u"vba_macro_functions.", FORMAT_ODS);


More information about the Libreoffice-commits mailing list