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

Eike Rathke erack at redhat.com
Wed Jul 20 15:18:20 UTC 2016


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

New commits:
commit 35595869d19f052cb585c82a1a7e174debb944b0
Author: Eike Rathke <erack at redhat.com>
Date:   Wed Jul 20 17:15:36 2016 +0200

    unit test for tdf#100637 nested IF in array context
    
    Change-Id: I6f4e1ca61afeda4a2fbe249b3e0625280414afae

diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx
index 25f42b8..b2bfb37 100644
--- a/sc/qa/unit/ucalc_formula.cxx
+++ b/sc/qa/unit/ucalc_formula.cxx
@@ -3926,6 +3926,14 @@ void Test::testFuncIF()
     m_pDoc->SetValue(ScAddress(1,0,0), 3.0);
     CPPUNIT_ASSERT_EQUAL(OUString("not two"), m_pDoc->GetString(ScAddress(0,0,0)));
 
+    // Test nested IF in array/matrix.
+    ScMarkData aMark;
+    aMark.SelectOneTable(0);
+    m_pDoc->InsertMatrixFormula(0,2, 1,2, aMark, "=IF({1;0};IF(1;23);42)");
+    // Results must be 23 and 42.
+    CPPUNIT_ASSERT_EQUAL(23.0, m_pDoc->GetValue(ScAddress(0,2,0)));
+    CPPUNIT_ASSERT_EQUAL(42.0, m_pDoc->GetValue(ScAddress(1,2,0)));
+
     m_pDoc->DeleteTab(0);
 }
 


More information about the Libreoffice-commits mailing list