[Libreoffice-commits] core.git: 2 commits - sc/qa

Markus Mohrhard markus.mohrhard at collabora.co.uk
Tue Dec 23 23:16:12 PST 2014


 sc/qa/unit/subsequent_filters-test.cxx |    2 +-
 sc/qa/unit/ucalc.hxx                   |    2 ++
 sc/qa/unit/ucalc_formula.cxx           |   23 +++++++++++++++++++++++
 3 files changed, 26 insertions(+), 1 deletion(-)

New commits:
commit 7bdb58940ff1cfa1d76bbad26c9cbac8bb2caf2a
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Wed Dec 24 05:11:43 2014 +0100

    fix comment
    
    Change-Id: I7a87fe9486d318dfbd7987264f35b279c1a9a014

diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index f27a5c2..2ba0050 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -2565,7 +2565,7 @@ void ScFiltersTest::testSharedFormulaXLSB()
     ScDocument& rDoc = xDocSh->GetDocument();
     rDoc.CalcAll();
 
-    // E6:E376 should be all formulas, and they should belong to the same group.
+    // A1:A30 should be all formulas, and they should belong to the same group.
     const ScFormulaCell* pFC = rDoc.GetFormulaCell(ScAddress(0,0,0));
     CPPUNIT_ASSERT(pFC);
     CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(0), pFC->GetSharedTopRow());
commit cf7b00b34fb06b1fd36e623b06cf91cfe3a8e792
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Mon Dec 22 22:13:18 2014 +0100

    add test for wrong matrix calculations
    
    Change-Id: Ie4e5169eba887ff373d7c1317efe725e9efa8c28

diff --git a/sc/qa/unit/ucalc.hxx b/sc/qa/unit/ucalc.hxx
index 0c39d6f..013ac26 100644
--- a/sc/qa/unit/ucalc.hxx
+++ b/sc/qa/unit/ucalc.hxx
@@ -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);
diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx
index 5deed05..ab23102 100644
--- a/sc/qa/unit/ucalc_formula.cxx
+++ b/sc/qa/unit/ucalc_formula.cxx
@@ -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: */


More information about the Libreoffice-commits mailing list