summaryrefslogtreecommitdiff
path: root/sc/qa
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2020-06-26 13:56:18 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2020-06-26 17:27:20 +0200
commit0960a8c5ce48adb1bc7bd434ed5242b51ce72149 (patch)
tree3c73c671a6c5a581ccf1d5832c2b8daeee9a4667 /sc/qa
parent8f1569568a2816dd4c6e4d9f015557d451ccfadf (diff)
tdf#130583: sc: Add unittest
Change-Id: I74f2d90f4f9eb17d1833ceedd1598c1439489354 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97222 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc/qa')
-rw-r--r--sc/qa/unit/data/ods/tdf130583.odsbin0 -> 10758 bytes
-rw-r--r--sc/qa/unit/subsequent_filters-test.cxx22
2 files changed, 22 insertions, 0 deletions
diff --git a/sc/qa/unit/data/ods/tdf130583.ods b/sc/qa/unit/data/ods/tdf130583.ods
new file mode 100644
index 000000000000..8cfcc97dd196
--- /dev/null
+++ b/sc/qa/unit/data/ods/tdf130583.ods
Binary files differ
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index ca1f0b53a983..f44980c7a146 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -245,6 +245,7 @@ public:
void testMergedCellsXLSXML();
void testBackgroundColorStandardXLSXML();
void testTdf131536();
+ void testTdf130583();
void testTdf85617();
void testTdf134234();
void testNamedExpressionsXLSXML();
@@ -394,6 +395,7 @@ public:
CPPUNIT_TEST(testMergedCellsXLSXML);
CPPUNIT_TEST(testBackgroundColorStandardXLSXML);
CPPUNIT_TEST(testTdf131536);
+ CPPUNIT_TEST(testTdf130583);
CPPUNIT_TEST(testTdf85617);
CPPUNIT_TEST(testTdf134234);
CPPUNIT_TEST(testNamedExpressionsXLSXML);
@@ -3849,6 +3851,26 @@ void ScFiltersTest::testTdf131536()
"=RIGHT(TEXT(INDEX($Comparison.$L:$Z,$Comparison.$A5,$Comparison.D$4),\"0\"),4))", nullptr);
}
+void ScFiltersTest::testTdf130583()
+{
+ ScDocShellRef xDocSh = loadDoc("tdf130583.", FORMAT_ODS);
+ CPPUNIT_ASSERT_MESSAGE("Failed to load the document", xDocSh.is());
+ ScDocument& rDoc = xDocSh->GetDocument();
+
+ CPPUNIT_ASSERT_EQUAL(OUString("b"), rDoc.GetString(ScAddress(1,0,0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("c"), rDoc.GetString(ScAddress(1,1,0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("a"), rDoc.GetString(ScAddress(1,2,0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("d"), rDoc.GetString(ScAddress(1,3,0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("#N/A"), rDoc.GetString(ScAddress(1,4,0)));
+
+ // Without the fix in place, SWITCH would have returned #VALUE!
+ CPPUNIT_ASSERT_EQUAL(OUString("b"), rDoc.GetString(ScAddress(4,0,0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("c"), rDoc.GetString(ScAddress(4,1,0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("a"), rDoc.GetString(ScAddress(4,2,0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("d"), rDoc.GetString(ScAddress(4,3,0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("#N/A"), rDoc.GetString(ScAddress(4,4,0)));
+}
+
void ScFiltersTest::testTdf85617()
{
ScDocShellRef xDocSh = loadDoc("tdf85617.", FORMAT_XLSX);