tdf#147894: sc_uicalc: Add unittest

Change-Id: Id7e5159542b17a510958ea8e22343e979720a56b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131527
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
This commit is contained in:
Xisco Fauli 2022-03-14 11:18:46 +01:00
parent 3a2c156eb8
commit 3d8c11a8ea

View file

@ -355,6 +355,31 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf63805)
CPPUNIT_ASSERT_EQUAL(OUString(""), pDoc->GetString(ScAddress(0, 1, 0)));
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf147894)
{
mxComponent = loadFromDesktop("private:factory/scalc");
ScModelObj* pModelObj = dynamic_cast<ScModelObj*>(mxComponent.get());
CPPUNIT_ASSERT(pModelObj);
ScDocument* pDoc = pModelObj->GetDocument();
CPPUNIT_ASSERT(pDoc);
//Select the first row
goToCell("1:1");
uno::Sequence<beans::PropertyValue> aArgs(
comphelper::InitPropertySequence({ { "FillDir", uno::Any(OUString("R")) },
{ "FillCmd", uno::Any(OUString("L")) },
{ "FillStep", uno::Any(OUString("1")) },
{ "FillDateCmd", uno::Any(OUString("D")) },
{ "FillStart", uno::Any(OUString("1")) } }));
// Without the fix in place, this test would have crashed here
dispatchCommand(mxComponent, ".uno:FillSeries", aArgs);
CPPUNIT_ASSERT_EQUAL(1.0, pDoc->GetValue(ScAddress(0, 0, 0)));
CPPUNIT_ASSERT_EQUAL(16384.0, pDoc->GetValue(ScAddress(16383, 0, 0)));
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf94208)
{
mxComponent = loadFromDesktop("private:factory/scalc");