diff options
-rw-r--r-- | sc/qa/unit/data/xls/opencl/statistical/DevSq.xls | bin | 0 -> 7680 bytes | |||
-rw-r--r-- | sc/qa/unit/opencl-test.cxx | 27 | ||||
-rw-r--r-- | sc/source/core/tool/token.cxx | 1 |
3 files changed, 28 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/opencl/statistical/DevSq.xls b/sc/qa/unit/data/xls/opencl/statistical/DevSq.xls Binary files differnew file mode 100644 index 000000000000..496be32fe831 --- /dev/null +++ b/sc/qa/unit/data/xls/opencl/statistical/DevSq.xls diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index 46109b6f0e1a..877dd707812d 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -220,6 +220,7 @@ public: void testStatisticalFormulaVarP(); void testMathFormulaCeil(); void testMathFormulaKombin(); + void testStatisticalFormulaDevSq(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -371,6 +372,7 @@ public: CPPUNIT_TEST(testStatisticalFormulaVarP); CPPUNIT_TEST(testMathFormulaCeil); CPPUNIT_TEST(testMathFormulaKombin); + CPPUNIT_TEST(testStatisticalFormulaDevSq); CPPUNIT_TEST_SUITE_END(); private: @@ -1915,6 +1917,31 @@ void ScOpenclTest::testMathFormulaCot() xDocSh->DoClose(); xDocShRes->DoClose(); } +//[AMLOEXT-89] +void ScOpenclTest::testStatisticalFormulaDevSq() +{ + if (!detectOpenCLDevice()) + return; + + ScDocShellRef xDocSh = loadDoc("opencl/statistical/DevSq.", XLS); + ScDocument* pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + + ScDocShellRef xDocShRes = loadDoc("opencl/statistical/DevSq.", XLS); + ScDocument* pDocRes = xDocShRes->GetDocument(); + CPPUNIT_ASSERT(pDocRes); + // Check the results of formula cells in the shared formula range. + for (SCROW i = 0; i <= 11; ++i) + { + double fLibre = pDoc->GetValue(ScAddress(1,i,0)); + double fExcel = pDocRes->GetValue(ScAddress(1,i,0)); + CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); + } + xDocSh->DoClose(); + xDocShRes->DoClose(); +} //[AMLOEXT-90] void ScOpenclTest::testMathFormulaCsc() { diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index 112fcce39ffd..6f0245c03e22 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -1452,6 +1452,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r ) case ocVarP: case ocCeil: case ocKombin: + case ocDevSq: // Don't change the state. break; default: |