Kaydet (Commit) cf7b00b3 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

add test for wrong matrix calculations

Change-Id: Ie4e5169eba887ff373d7c1317efe725e9efa8c28
üst 673b22a7
......@@ -177,6 +177,7 @@ public:
void testFuncNOW();
void testFuncGETPIVOTDATA();
void testFuncGETPIVOTDATALeafAccess();
void testMatrixOp();
void testExternalRef();
void testExternalRefFunctions();
......@@ -483,6 +484,7 @@ public:
CPPUNIT_TEST(testFuncIFERROR);
CPPUNIT_TEST(testFuncGETPIVOTDATA);
CPPUNIT_TEST(testFuncGETPIVOTDATALeafAccess);
CPPUNIT_TEST(testMatrixOp);
CPPUNIT_TEST(testExternalRef);
CPPUNIT_TEST(testExternalRefFunctions);
CPPUNIT_TEST(testCopyToDocument);
......
......@@ -4847,4 +4847,27 @@ void Test::testExternalRefFunctions()
m_pDoc->DeleteTab(0);
}
void Test::testMatrixOp()
{
m_pDoc->InsertTab(0, "Test");
for (SCROW nRow = 0; nRow < 4; ++nRow)
{
m_pDoc->SetValue(0, nRow, 0, nRow);
}
m_pDoc->SetValue(1, 0, 0, 2.0);
m_pDoc->SetValue(3, 0, 0, 1.0);
m_pDoc->SetValue(3, 1, 0, 2.0);
m_pDoc->SetString(2, 0, 0, "=SUMPRODUCT((A1:A4)*B1+D1)");
m_pDoc->SetString(2, 1, 0, "=SUMPRODUCT((A1:A4)*B1-D2)");
double nVal = m_pDoc->GetValue(2, 0, 0);
CPPUNIT_ASSERT_EQUAL(16.0, nVal);
nVal = m_pDoc->GetValue(2, 1, 0);
CPPUNIT_ASSERT_EQUAL(4.0, nVal);
m_pDoc->DeleteTab(0);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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