summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-04-24 12:31:02 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-04-24 12:51:59 -0400
commitd36442aa31a57b8c559f33564dde5366358564f1 (patch)
tree2d7d3f8449dfbcfec780874120de742febe3afce /sc
parente5e051b23b3b0a767b1d5d22c65d8d648c251fd3 (diff)
fdo#76663: Better test to really test PRODUCT with array input.
The first element should be something other than 1 to make this a better check. Change-Id: I2dc108a2e755034f584fef781eb5668b629dc3fd
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/unit/ucalc_formula.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx
index 4544ac6eb8e7..254962e506c5 100644
--- a/sc/qa/unit/ucalc_formula.cxx
+++ b/sc/qa/unit/ucalc_formula.cxx
@@ -2163,6 +2163,8 @@ void Test::testFuncSUM()
void Test::testFuncPRODUCT()
{
+ sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto recalc.
+
OUString aTabName("foo");
CPPUNIT_ASSERT_MESSAGE ("failed to insert sheet",
m_pDoc->InsertTab (0, aTabName));
@@ -2175,14 +2177,12 @@ void Test::testFuncPRODUCT()
val = 3;
m_pDoc->SetValue(0, 2, 0, val);
m_pDoc->SetString(0, 3, 0, OUString("=PRODUCT(A1:A3)"));
- m_pDoc->CalcAll();
m_pDoc->GetValue(0, 3, 0, result);
CPPUNIT_ASSERT_MESSAGE("Calculation of PRODUCT failed", result == 6.0);
- m_pDoc->SetString(0, 4, 0, OUString("=PRODUCT({1;2;3})"));
- m_pDoc->CalcAll();
+ m_pDoc->SetString(0, 4, 0, OUString("=PRODUCT({2;3;4})"));
m_pDoc->GetValue(0, 4, 0, result);
- CPPUNIT_ASSERT_MESSAGE("Calculation of PRODUCT with inline array failed", result == 6.0);
+ CPPUNIT_ASSERT_MESSAGE("Calculation of PRODUCT with inline array failed", result == 24.0);
m_pDoc->DeleteTab(0);
}