summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2020-07-09 13:56:46 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2020-07-09 20:34:07 +0200
commit96547693533aa0261ed46c19f922b3b8172591e3 (patch)
treeacd2299cfd8dda34b8ba461d8bd33e21eade01ba /sc
parentc6aa0d055ec6a102c269a4e1cd0fa98fd7c99d66 (diff)
tdf#124454: sc: Add unittest
Change-Id: Id7b606c0e7e3621ea855af325c755876e11ebc66 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98429 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/unit/data/ods/tdf124454.odsbin0 -> 7555 bytes
-rw-r--r--sc/qa/unit/subsequent_filters-test.cxx18
2 files changed, 18 insertions, 0 deletions
diff --git a/sc/qa/unit/data/ods/tdf124454.ods b/sc/qa/unit/data/ods/tdf124454.ods
new file mode 100644
index 000000000000..c312ccb4f5db
--- /dev/null
+++ b/sc/qa/unit/data/ods/tdf124454.ods
Binary files differ
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 8399cef636e8..52f304235473 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -195,6 +195,7 @@ public:
void testCustomNumFormatHybridCellODS();
void testTdf121040();
void testTdf118624();
+ void testTdf124454();
void testPrintRangeODS();
void testOutlineODS();
@@ -357,6 +358,7 @@ public:
CPPUNIT_TEST(testCustomNumFormatHybridCellODS);
CPPUNIT_TEST(testTdf121040);
CPPUNIT_TEST(testTdf118624);
+ CPPUNIT_TEST(testTdf124454);
CPPUNIT_TEST(testPrintRangeODS);
CPPUNIT_TEST(testOutlineODS);
CPPUNIT_TEST(testColumnStyleXLSX);
@@ -2952,6 +2954,22 @@ void ScFiltersTest::testTdf118624()
xDocSh->DoClose();
}
+void ScFiltersTest::testTdf124454()
+{
+ ScDocShellRef xDocSh = loadDoc("tdf124454.", FORMAT_ODS);
+ CPPUNIT_ASSERT_MESSAGE("Failed to open doc", xDocSh.is());
+
+ ScDocument& rDoc = xDocSh->GetDocument();
+
+ CPPUNIT_ASSERT_EQUAL(OUString("1"), rDoc.GetString(ScAddress(1,0,0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("1"), rDoc.GetString(ScAddress(2,0,0)));
+ // Without the fix in place, double negation with text in array
+ // would have returned -1
+ CPPUNIT_ASSERT_EQUAL(OUString("1"), rDoc.GetString(ScAddress(3,0,0)));
+
+ xDocSh->DoClose();
+}
+
void ScFiltersTest::testPrintRangeODS()
{
ScDocShellRef xDocSh = loadDoc("print-range.", FORMAT_ODS);