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

Eike Rathke erack at redhat.com
Thu Mar 3 12:33:31 UTC 2016


 sc/qa/unit/ucalc_formula.cxx |   12 ++++++++++++
 1 file changed, 12 insertions(+)

New commits:
commit 6e7e8af8ed2ee873a5c8a8b7b42fe3b99797be90
Author: Eike Rathke <erack at redhat.com>
Date:   Thu Mar 3 13:31:19 2016 +0100

    unit test for tdf#98297, exclude/include error values with COUNT/COUNTA
    
    Change-Id: I2cc7d6ebdcb9411060462d7afa704f9e100c6c5e

diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx
index ad40ccc..63aa7d9 100644
--- a/sc/qa/unit/ucalc_formula.cxx
+++ b/sc/qa/unit/ucalc_formula.cxx
@@ -3383,6 +3383,18 @@ void Test::testFuncCOUNT()
     m_pDoc->SetString(aPos, "=COUNT(A1:A3;2;4;6)");
     CPPUNIT_ASSERT_EQUAL(6.0, m_pDoc->GetValue(aPos));
 
+    // Matrix in C1.
+    ScMarkData aMark;
+    aMark.SelectOneTable(0);
+    m_pDoc->InsertMatrixFormula(2, 0, 2, 0, aMark, "=COUNT(SEARCH(\"a\";{\"a\";\"b\";\"a\"}))");
+    // Check that the #VALUE! error of "a" not found in "b" is not counted.
+    CPPUNIT_ASSERT_EQUAL(2.0, m_pDoc->GetValue(ScAddress(2,0,0)));
+
+    // Matrix in C3.
+    m_pDoc->InsertMatrixFormula(2, 2, 2, 2, aMark, "=COUNTA(SEARCH(\"a\";{\"a\";\"b\";\"a\"}))");
+    // Check that the #VALUE! error of "a" not found in "b" is counted.
+    CPPUNIT_ASSERT_EQUAL(3.0, m_pDoc->GetValue(ScAddress(2,2,0)));
+
     m_pDoc->DeleteTab(0);
 }
 


More information about the Libreoffice-commits mailing list