[Libreoffice-commits] core.git: sc/qa
Xisco Fauli (via logerrit)
logerrit at kemper.freedesktop.org
Wed Mar 24 20:40:25 UTC 2021
sc/qa/unit/data/ods/tdf101104.ods |binary
sc/qa/unit/subsequent_filters-test.cxx | 33 +++++++++++++++++++++++++++++++++
2 files changed, 33 insertions(+)
New commits:
commit 6cc9f2ee740f51bf49e031135ce7c44d19cefe9c
Author: Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Wed Mar 24 10:17:39 2021 +0100
Commit: Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Wed Mar 24 21:39:42 2021 +0100
tdf#101104: sc_subsequent_filters: Add unittest
Change-Id: Ifd39b958d011db0ca1575bc340bc23983075062d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113025
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
diff --git a/sc/qa/unit/data/ods/tdf101104.ods b/sc/qa/unit/data/ods/tdf101104.ods
new file mode 100644
index 000000000000..d33bb90f2777
Binary files /dev/null and b/sc/qa/unit/data/ods/tdf101104.ods differ
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 09d0f6df601a..fd55c00f6a89 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -162,6 +162,7 @@ public:
void testCondFormatThemeColor2XLSX(); // negative bar color and axis color
void testCondFormatThemeColor3XLSX(); // theme index 2 and 3 are switched
void testComplexIconSetsXLSX();
+ void testTdf101104();
void testTdf64401();
void testCondFormatParentXLSX();
void testColorScaleNumWithRefXLSX();
@@ -376,6 +377,7 @@ public:
CPPUNIT_TEST(testCondFormatThemeColor2XLSX);
CPPUNIT_TEST(testCondFormatThemeColor3XLSX);
CPPUNIT_TEST(testComplexIconSetsXLSX);
+ CPPUNIT_TEST(testTdf101104);
CPPUNIT_TEST(testTdf64401);
CPPUNIT_TEST(testCondFormatParentXLSX);
CPPUNIT_TEST(testColorScaleNumWithRefXLSX);
@@ -2806,6 +2808,37 @@ void ScFiltersTest::testComplexIconSetsXLSX()
xDocSh->DoClose();
}
+void ScFiltersTest::testTdf101104()
+{
+ ScDocShellRef xDocSh = ScBootstrapFixture::loadDoc(u"tdf101104.", FORMAT_ODS);
+
+ CPPUNIT_ASSERT_MESSAGE("Failed to load tdf101104.ods", xDocSh.is());
+
+ ScDocument& rDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT_EQUAL(size_t(2), rDoc.GetCondFormList(0)->size());
+
+ ScConditionalFormat* pFormat = rDoc.GetCondFormat(1, 1, 0);
+ CPPUNIT_ASSERT(pFormat);
+ CPPUNIT_ASSERT_EQUAL(size_t(1), pFormat->size());
+ const ScFormatEntry* pEntry = pFormat->GetEntry(0);
+ CPPUNIT_ASSERT(pEntry);
+ CPPUNIT_ASSERT_EQUAL(ScFormatEntry::Type::Iconset, pEntry->GetType());
+ const ScIconSetFormat* pIconSet = static_cast<const ScIconSetFormat*>(pEntry);
+
+ for(size_t i = 1; i < 10; ++i)
+ {
+ std::unique_ptr<ScIconSetInfo> pInfo(pIconSet->GetIconSetInfo(ScAddress(1, i, 0)));
+
+ // Without the fix in place, this test would have failed here
+ CPPUNIT_ASSERT(pInfo);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2), pInfo->nIconIndex);
+ CPPUNIT_ASSERT_EQUAL(IconSet_3Arrows, pInfo->eIconSetType);
+
+ }
+
+ xDocSh->DoClose();
+}
+
void ScFiltersTest::testTdf64401()
{
ScDocShellRef xDocSh = ScBootstrapFixture::loadDoc(u"tdf64401.", FORMAT_ODS);
More information about the Libreoffice-commits
mailing list