tdf#93415: sc_ucalc: Add unittest
Change-Id: Id06ceb081459831637ee78e0a049cf7099772372
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111942
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
diff --git a/sc/qa/unit/ucalc.hxx b/sc/qa/unit/ucalc.hxx
index 7c38201..19c16ee 100644
--- a/sc/qa/unit/ucalc.hxx
+++ b/sc/qa/unit/ucalc.hxx
@@ -567,6 +567,7 @@ public:
void testTdf97369();
void testTdf97587();
void testTdf107459();
void testTdf93415();
void testTdf133260();
void testTdf100818();
@@ -878,6 +879,7 @@ public:
CPPUNIT_TEST(testTdf97369);
CPPUNIT_TEST(testTdf97587);
CPPUNIT_TEST(testTdf107459);
CPPUNIT_TEST(testTdf93415);
CPPUNIT_TEST(testTdf133260);
CPPUNIT_TEST(testTdf100818);
CPPUNIT_TEST(testEmptyCalcDocDefaults);
diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx
index 6d8d402..1882fbc 100644
--- a/sc/qa/unit/ucalc_formula.cxx
+++ b/sc/qa/unit/ucalc_formula.cxx
@@ -8637,6 +8637,26 @@ void Test::testTdf107459()
m_pDoc->DeleteTab(0);
}
void Test::testTdf93415()
{
CPPUNIT_ASSERT(m_pDoc->InsertTab (0, "Sheet1"));
ScCalcConfig aConfig;
aConfig.SetStringRefSyntax( formula::FormulaGrammar::CONV_XL_R1C1 );
m_pDoc->SetCalcConfig(aConfig);
m_pDoc->CalcAll();
ScAddress aPos(0,0,0);
m_pDoc->SetString(aPos, "=ADDRESS(1,1,,,\"Sheet1\")");
// Without the fix in place, this would have failed with
// - Expected: Sheet1!$A$1
// - Actual : Sheet1.$A$1
CPPUNIT_ASSERT_EQUAL(OUString("Sheet1!$A$1"), m_pDoc->GetString(aPos));
m_pDoc->DeleteTab(0);
}
void Test::testTdf133260()
{
CPPUNIT_ASSERT(m_pDoc->InsertTab (0, "Test"));