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

Eike Rathke erack at redhat.com
Tue May 23 11:39:55 UTC 2017


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

New commits:
commit 28ff25934ca1442a4a7f22f0d915ed7b782ca379
Author: Eike Rathke <erack at redhat.com>
Date:   Tue May 23 13:39:12 2017 +0200

    Unit test for COUNTBLANK with array of references, tdf#58874
    
    Change-Id: I44c4db675b822c0456197bf019783076cb7a4b78

diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx
index 620d94bc2e38..b5c5f9f85879 100644
--- a/sc/qa/unit/ucalc_formula.cxx
+++ b/sc/qa/unit/ucalc_formula.cxx
@@ -7994,6 +7994,18 @@ void Test::testFuncRefListArraySUBTOTAL()
     aPos.IncRow();
     CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("SUBTOTAL STDEV for A1:A2,A4:A5,A5:A6 failed", 11.55422, m_pDoc->GetValue(aPos), 1e-5);
 
+    // Empty two cells such that they affect two ranges.
+    m_pDoc->SetString(0,1,0, "");   // A2
+    m_pDoc->SetString(0,2,0, "");   // A3
+    // Matrix in J7:J9, individual COUNTBLANK of A2:A3, A3:A4 and A4:A5
+    m_pDoc->InsertMatrixFormula(9, 6, 9, 8, aMark, "=COUNTBLANK(OFFSET(A1;ROW(1:3);0;2))");
+    aPos.Set(9,6,0);
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("COUNTBLANK for A1:A2,A2:A3,A5:A6 failed", 2.0, m_pDoc->GetValue(aPos));
+    aPos.IncRow();
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("COUNTBLANK for A1:A2,A3:A4,A5:A6 failed", 1.0, m_pDoc->GetValue(aPos));
+    aPos.IncRow();
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("COUNTBLANK for A1:A2,A4:A5,A5:A6 failed", 0.0, m_pDoc->GetValue(aPos));
+
     m_pDoc->DeleteTab(0);
 }
 


More information about the Libreoffice-commits mailing list