Kaydet (Commit) d36442aa authored tarafından Kohei Yoshida's avatar Kohei Yoshida

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
üst e5e051b2
...@@ -2163,6 +2163,8 @@ void Test::testFuncSUM() ...@@ -2163,6 +2163,8 @@ void Test::testFuncSUM()
void Test::testFuncPRODUCT() void Test::testFuncPRODUCT()
{ {
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto recalc.
OUString aTabName("foo"); OUString aTabName("foo");
CPPUNIT_ASSERT_MESSAGE ("failed to insert sheet", CPPUNIT_ASSERT_MESSAGE ("failed to insert sheet",
m_pDoc->InsertTab (0, aTabName)); m_pDoc->InsertTab (0, aTabName));
...@@ -2175,14 +2177,12 @@ void Test::testFuncPRODUCT() ...@@ -2175,14 +2177,12 @@ void Test::testFuncPRODUCT()
val = 3; val = 3;
m_pDoc->SetValue(0, 2, 0, val); m_pDoc->SetValue(0, 2, 0, val);
m_pDoc->SetString(0, 3, 0, OUString("=PRODUCT(A1:A3)")); m_pDoc->SetString(0, 3, 0, OUString("=PRODUCT(A1:A3)"));
m_pDoc->CalcAll();
m_pDoc->GetValue(0, 3, 0, result); m_pDoc->GetValue(0, 3, 0, result);
CPPUNIT_ASSERT_MESSAGE("Calculation of PRODUCT failed", result == 6.0); CPPUNIT_ASSERT_MESSAGE("Calculation of PRODUCT failed", result == 6.0);
m_pDoc->SetString(0, 4, 0, OUString("=PRODUCT({1;2;3})")); m_pDoc->SetString(0, 4, 0, OUString("=PRODUCT({2;3;4})"));
m_pDoc->CalcAll();
m_pDoc->GetValue(0, 4, 0, result); 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); m_pDoc->DeleteTab(0);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment