diff options
author | Łukasz Hryniuk <lukasz.hryniuk@wp.pl> | 2015-09-25 14:56:11 +0200 |
---|---|---|
committer | Łukasz Hryniuk <lukasz.hryniuk@wp.pl> | 2015-09-25 15:48:30 +0200 |
commit | b24286e46ebd0dbc2acbea30627572a66707f346 (patch) | |
tree | b26b4395f050319c73b9f97724c6e41f37708ad5 /sc | |
parent | 2b0413a7d79f9df0b29bc2f27599b95eba1c7bdc (diff) |
Testcases with several arrays for SUM and PRODUCT
Change-Id: I0e710b6a53af3aa062a17e0a998691e1ec6d3973
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/unit/ucalc_formula.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx index 195343b4b61c..58d1e6b525f5 100644 --- a/sc/qa/unit/ucalc_formula.cxx +++ b/sc/qa/unit/ucalc_formula.cxx @@ -3390,6 +3390,13 @@ void Test::testFuncPRODUCT() m_pDoc->SetString(aPos, OUString("=PRODUCT({8;0.125;-1})")); CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of PRODUCT with inline array failed", -1.0, m_pDoc->GetValue(aPos)); + m_pDoc->SetString(aPos, OUString("=PRODUCT({2;3};{4;5})")); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of PRODUCT with inline array failed", 120.0, m_pDoc->GetValue(aPos)); + m_pDoc->SetString(aPos, OUString("=PRODUCT({10;-8};{3;-1};{15;30};{7})")); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of PRODUCT with inline array failed", 756000.0, m_pDoc->GetValue(aPos)); + m_pDoc->SetString(aPos, OUString("=PRODUCT({10;-0.1;8};{0.125;4;0.25;2};{0.5};{1};{-1})")); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of PRODUCT with inline array failed", 1.0, m_pDoc->GetValue(aPos)); + m_pDoc->DeleteTab(0); } @@ -6364,6 +6371,15 @@ void Test::testFuncSUMSQ() m_pDoc->SetString(aPos, "=SUMSQ({\"a\";-4;-5})"); CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of SUMSQ for failed", 41.0, m_pDoc->GetValue(aPos)); + m_pDoc->SetString(aPos, "=SUMSQ({2;3};{4;5})"); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of SUMSQ for failed", 54.0, m_pDoc->GetValue(aPos)); + m_pDoc->SetString(aPos, "=SUMSQ({-3;3;1};{-1})"); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of SUMSQ for failed", 20.0, m_pDoc->GetValue(aPos)); + m_pDoc->SetString(aPos, "=SUMSQ({-4};{1;4;2};{-5;7};{9})"); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of SUMSQ for failed", 192.0, m_pDoc->GetValue(aPos)); + m_pDoc->SetString(aPos, "=SUMSQ({-2;2};{1};{-1};{0;0;0;4})"); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of SUMSQ for failed", 26.0, m_pDoc->GetValue(aPos)); + m_pDoc->SetString(aPos, "=SUMSQ(4;1;-3)"); CPPUNIT_ASSERT_EQUAL_MESSAGE("Calculation of SUMSQ for failed", 26.0, m_pDoc->GetValue(aPos)); m_pDoc->SetString(aPos, "=SUMSQ(0;5;13;-7;-4)"); |