[Libreoffice-commits] core.git: sc/qa
Xisco Fauli (via logerrit)
logerrit at kemper.freedesktop.org
Mon May 10 22:40:57 UTC 2021
sc/qa/unit/ucalc.cxx | 20 ++++++++++++++++++++
sc/qa/unit/ucalc.hxx | 2 ++
2 files changed, 22 insertions(+)
New commits:
commit 2d7db1f688fc3b7e7ce9276776a40d6d8db8d536
Author: Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Mon May 10 23:18:30 2021 +0200
Commit: Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Tue May 11 00:40:17 2021 +0200
tdf#134490: sc_ucalc: Add unittest
Change-Id: Iac75d72506eceb6d1104f607d32cdf82c68fb566
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115365
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index f03c8fe073d8..2774772365b1 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -488,6 +488,26 @@ void Test::testTdf90698()
m_pDoc->DeleteTab(0);
}
+void Test::testTdf134490()
+{
+ CPPUNIT_ASSERT(m_pDoc->InsertTab (0, "Test"));
+
+ m_pDoc->SetString(ScAddress(0,0,0), "--1");
+ m_pDoc->SetString(ScAddress(0,1,0), "---1");
+ m_pDoc->SetString(ScAddress(0,2,0), "+-1");
+ m_pDoc->SetString(ScAddress(0,3,0), "+--1");
+
+ // Without the fix in place, this test would have failed with
+ // - Expected: --1
+ // - Actual : -1
+ CPPUNIT_ASSERT_EQUAL(OUString("--1"), m_pDoc->GetString(ScAddress(0,0,0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("---1"), m_pDoc->GetString(ScAddress(0,1,0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("+-1"), m_pDoc->GetString(ScAddress(0,2,0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("+--1"), m_pDoc->GetString(ScAddress(0,3,0)));
+
+ m_pDoc->DeleteTab(0);
+}
+
void Test::testTdf135249()
{
CPPUNIT_ASSERT(m_pDoc->InsertTab (0, "Test"));
diff --git a/sc/qa/unit/ucalc.hxx b/sc/qa/unit/ucalc.hxx
index fe9d6f09c1cd..5a0b1e2c5b5b 100644
--- a/sc/qa/unit/ucalc.hxx
+++ b/sc/qa/unit/ucalc.hxx
@@ -127,6 +127,7 @@ public:
void testInput();
void testColumnIterator();
void testTdf90698();
+ void testTdf134490();
void testTdf135249();
void testDocStatistics();
void testRowForHeight();
@@ -642,6 +643,7 @@ public:
CPPUNIT_TEST(testInput);
CPPUNIT_TEST(testColumnIterator);
CPPUNIT_TEST(testTdf90698);
+ CPPUNIT_TEST(testTdf134490);
CPPUNIT_TEST(testTdf135249);
CPPUNIT_TEST(testDocStatistics);
CPPUNIT_TEST(testRowForHeight);
More information about the Libreoffice-commits
mailing list