sc/qa/unit/data/ods/tdf151046.ods |binary sc/qa/unit/subsequent_filters_test.cxx | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+)
New commits: commit dfa01bb05cc82811cdc306285a31c51816f81c6a Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Mon Sep 19 17:18:11 2022 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Mon Sep 19 23:40:19 2022 +0200 tdf#151046: sc_subsequent_filters: Add unittest Change-Id: I552d53f511373b170985185361621d8e149e582b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140184 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sc/qa/unit/data/ods/tdf151046.ods b/sc/qa/unit/data/ods/tdf151046.ods new file mode 100644 index 000000000000..bcda940c3293 Binary files /dev/null and b/sc/qa/unit/data/ods/tdf151046.ods differ diff --git a/sc/qa/unit/subsequent_filters_test.cxx b/sc/qa/unit/subsequent_filters_test.cxx index 9149d4379db4..d7a6ee45b616 100644 --- a/sc/qa/unit/subsequent_filters_test.cxx +++ b/sc/qa/unit/subsequent_filters_test.cxx @@ -171,6 +171,7 @@ public: void testCellAnchoredHiddenShapesXLSX(); void testFormulaDependency(); + void testTdf151046(); void testRowHeightODS(); void testRichTextContentODS(); @@ -266,6 +267,7 @@ public: CPPUNIT_TEST(testRowHeightODS); CPPUNIT_TEST(testFormulaDependency); + CPPUNIT_TEST(testTdf151046); CPPUNIT_TEST(testRichTextContentODS); //disable testPassword on MacOSX due to problems with libsqlite3 @@ -2980,6 +2982,23 @@ void ScFiltersTest::testFormulaDependency() xDocSh->DoClose(); } +void ScFiltersTest::testTdf151046() +{ + ScDocShellRef xDocSh = loadDoc(u"tdf151046.", FORMAT_ODS); + + ScDocument& rDoc = xDocSh->GetDocument(); + + CPPUNIT_ASSERT_EQUAL(1.0, rDoc.GetValue(0, 0, 0)); + CPPUNIT_ASSERT_EQUAL(1.0, rDoc.GetValue(0, 1, 0)); + + // Without the fix in place, this test would have failed with + // - Expected: 1 + // - Actual : 0 + CPPUNIT_ASSERT_EQUAL(1.0, rDoc.GetValue(0, 2, 0)); + + xDocSh->DoClose(); +} + void ScFiltersTest::testImportCrashes() { testImportCrash(u"tdf149752.", FORMAT_ODS); testImportCrash(u"tdf122643.", FORMAT_ODS);