diff options
-rw-r--r-- | sc/qa/unit/data/xls/opencl/statistical/VarP.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/VarP.xls b/sc/qa/unit/data/xls/opencl/statistical/VarP.xls Binary files differnew file mode 100644 index 000000000000..3263ffb4d7be --- /dev/null +++ b/sc/qa/unit/data/xls/opencl/statistical/VarP.xls diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index 8a4eaf94d04c..d64f1f53d09f 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -217,6 +217,7 @@ public: void testStatisticalFormulaSkewp(); void testMathFormulaSqrtPi(); void testStatisticalFormulaBinomDist(); + void testStatisticalFormulaVarP(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -365,6 +366,7 @@ public: CPPUNIT_TEST(testStatisticalFormulaSkewp); CPPUNIT_TEST(testMathFormulaSqrtPi); CPPUNIT_TEST(testStatisticalFormulaBinomDist); + CPPUNIT_TEST(testStatisticalFormulaVarP); CPPUNIT_TEST_SUITE_END(); private: @@ -4103,6 +4105,31 @@ void ScOpenclTest::testMathFormulaSqrtPi() xDocSh->DoClose(); xDocShRes->DoClose(); } +//[AMLOEXT-183] +void ScOpenclTest::testStatisticalFormulaVarP() +{ + if (!detectOpenCLDevice()) + return; + + ScDocShellRef xDocSh = loadDoc("opencl/statistical/VarP.", XLS); + ScDocument* pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + + ScDocShellRef xDocShRes = loadDoc("opencl/statistical/VarP.", 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(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-192] void ScOpenclTest::testStatisticalFormulaBinomDist() { diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index 5d9eeba64893..b21eefbe6abe 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -1449,6 +1449,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r ) case ocSumSQ: case ocSkewp: case ocBinomDist: + case ocVarP: // Don't change the state. break; default: |