Kaydet (Commit) 99210a14 authored tarafından Eike Rathke's avatar Eike Rathke

Unit test for implicit intersection with shared formulas, tdf#114251 related

Change-Id: I8c11c2719b9496fd33194a7a9906e53f23f38f66
Reviewed-on: https://gerrit.libreoffice.org/46648Reviewed-by: 's avatarEike Rathke <erack@redhat.com>
Tested-by: 's avatarJenkins <ci@libreoffice.org>
üst 5afa7678
......@@ -262,6 +262,29 @@ void Test::testSharedFormulas()
CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(2), pFC->GetSharedLength());
CPPUNIT_ASSERT_EQUAL_MESSAGE("The token is expected to be shared.", pFC->GetCode(), pFC->GetSharedCode());
// Test implicit intersection with shared formulas.
aPos.Set(2,0,0);
{
// Insert data in C1:D2 and formulas in E1:E2
const char* pData[][3] = {
{ "5", "1", "=C:C/D:D" },
{ "4", "2", "=C:C/D:D" }
};
insertRangeData(m_pDoc, aPos, pData, SAL_N_ELEMENTS(pData));
}
aPos.Set(4,1,0);
pFC = m_pDoc->GetFormulaCell(aPos);
CPPUNIT_ASSERT_MESSAGE("E2 should be a formula cell.", pFC);
CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(0), pFC->GetSharedTopRow());
CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(2), pFC->GetSharedLength());
CPPUNIT_ASSERT_EQUAL_MESSAGE("The token is expected to be shared.", pFC->GetCode(), pFC->GetSharedCode());
aPos.SetRow(0);
CPPUNIT_ASSERT_EQUAL_MESSAGE("5/1=5", 5.0, m_pDoc->GetValue(aPos));
aPos.SetRow(1);
CPPUNIT_ASSERT_EQUAL_MESSAGE("4/2=2", 2.0, m_pDoc->GetValue(aPos));
m_pDoc->DeleteTab(0);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment