Add test for cell function COLUMN.
This currently fails. Change-Id: I6a73bc5a3e966542f4dcc88fc644110ec164dcb3
This commit is contained in:
@@ -89,6 +89,7 @@ public:
|
||||
void testFormulaRefUpdate();
|
||||
void testFormulaRefUpdateRange();
|
||||
void testFormulaRefUpdateSheets();
|
||||
void testFuncCOLUMN();
|
||||
void testFuncSUM();
|
||||
void testFuncPRODUCT();
|
||||
void testFuncN();
|
||||
@@ -278,6 +279,7 @@ public:
|
||||
CPPUNIT_TEST(testFormulaRefUpdate);
|
||||
CPPUNIT_TEST(testFormulaRefUpdateRange);
|
||||
CPPUNIT_TEST(testFormulaRefUpdateSheets);
|
||||
CPPUNIT_TEST(testFuncCOLUMN);
|
||||
CPPUNIT_TEST(testFuncSUM);
|
||||
CPPUNIT_TEST(testFuncPRODUCT);
|
||||
CPPUNIT_TEST(testFuncN);
|
||||
|
@@ -817,6 +817,27 @@ void Test::testFormulaRefUpdateSheets()
|
||||
m_pDoc->DeleteTab(0);
|
||||
}
|
||||
|
||||
void Test::testFuncCOLUMN()
|
||||
{
|
||||
m_pDoc->InsertTab(0, "Formula");
|
||||
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
|
||||
|
||||
m_pDoc->SetString(ScAddress(5,10,0), "=COLUMN()");
|
||||
CPPUNIT_ASSERT_EQUAL(6.0, m_pDoc->GetValue(ScAddress(5,10,0)));
|
||||
|
||||
m_pDoc->SetString(ScAddress(0,1,0), "=F11");
|
||||
CPPUNIT_ASSERT_EQUAL(6.0, m_pDoc->GetValue(ScAddress(0,1,0)));
|
||||
|
||||
// Move the formula cell with COLUMN() function to change its value.
|
||||
m_pDoc->InsertCol(ScRange(5,0,0,5,MAXROW,0));
|
||||
CPPUNIT_ASSERT_EQUAL(7.0, m_pDoc->GetValue(ScAddress(6,10,0)));
|
||||
|
||||
// The cell that references the moved cell should update its value as well.
|
||||
CPPUNIT_ASSERT_EQUAL(7.0, m_pDoc->GetValue(ScAddress(0,1,0)));
|
||||
|
||||
m_pDoc->DeleteTab(0);
|
||||
}
|
||||
|
||||
void Test::testFuncSUM()
|
||||
{
|
||||
OUString aTabName("foo");
|
||||
|
Reference in New Issue
Block a user