diff --git a/sc/qa/unit/data/xls/opencl/statistical/Standard.xls b/sc/qa/unit/data/xls/opencl/statistical/Standard.xls new file mode 100644 index 000000000000..fe735e52b248 Binary files /dev/null and b/sc/qa/unit/data/xls/opencl/statistical/Standard.xls differ diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index 87414c04b451..d108f83f0d8b 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -128,6 +128,7 @@ public: void testMathFormulaSin(); void testMathFormulaTan(); void testMathFormulaTanH(); + void testStatisticalFormulaStandard(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -187,6 +188,7 @@ public: CPPUNIT_TEST(testMathFormulaSin); CPPUNIT_TEST(testMathFormulaTan); CPPUNIT_TEST(testMathFormulaTanH); + CPPUNIT_TEST(testStatisticalFormulaStandard); CPPUNIT_TEST_SUITE_END(); private: @@ -1359,6 +1361,31 @@ void ScOpenclTest::testFinacialINTRATEFormula() xDocSh->DoClose(); xDocShRes->DoClose(); } +//[AMLOEXT-77] +void ScOpenclTest::testStatisticalFormulaStandard() +{ + if (!detectOpenCLDevice()) + return; + + ScDocShellRef xDocSh = loadDoc("opencl/statistical/Standard.", XLS); + ScDocument* pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + + ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Standard.", XLS); + ScDocument* pDocRes = xDocShRes->GetDocument(); + CPPUNIT_ASSERT(pDocRes); + // Check the results of formula cells in the shared formula range. + for (SCROW i = 1; i <= 20; ++i) + { + double fLibre = pDoc->GetValue(ScAddress(3,i,0)); + double fExcel = pDocRes->GetValue(ScAddress(3,i,0)); + CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); + } + xDocSh->DoClose(); + xDocShRes->DoClose(); +} //[AMLOEXT-82] void ScOpenclTest::testStatisticalFormulaPearson() { diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index ee9e1ce3a052..2de1508e21bc 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -1374,6 +1374,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r ) case ocSin: case ocTan: case ocTanHyp: + case ocStandard: // Don't change the state. break; default: