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>
diff --git a/sc/qa/unit/data/ods/tdf124454.ods b/sc/qa/unit/data/ods/tdf124454.ods
new file mode 100644
index 0000000..c312ccb4
--- /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 8399cef..52f3042 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);