diff options
-rw-r--r-- | sc/qa/unit/data/xls/opencl/statistical/ZTest.xls | bin | 0 -> 8192 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/ZTest.xls b/sc/qa/unit/data/xls/opencl/statistical/ZTest.xls Binary files differnew file mode 100644 index 000000000000..115fdbc16eb8 --- /dev/null +++ b/sc/qa/unit/data/xls/opencl/statistical/ZTest.xls diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index 94031561d3b8..d71f0ef5a1d0 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -224,6 +224,7 @@ public: void testStatisticalFormulaStDev(); void testStatisticalFormulaSlope(); void testStatisticalFormulaSTEYX(); + void testStatisticalFormulaZTest(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -379,6 +380,7 @@ public: CPPUNIT_TEST(testStatisticalFormulaStDev); CPPUNIT_TEST(testStatisticalFormulaSlope); CPPUNIT_TEST(testStatisticalFormulaSTEYX); + CPPUNIT_TEST(testStatisticalFormulaZTest); CPPUNIT_TEST_SUITE_END(); private: @@ -4267,6 +4269,31 @@ void ScOpenclTest::testStatisticalFormulaSTEYX() xDocSh->DoClose(); xDocShRes->DoClose(); } +//[AMLOEXT-188] +void ScOpenclTest::testStatisticalFormulaZTest() +{ + if (!detectOpenCLDevice()) + return; + + ScDocShellRef xDocSh = loadDoc("opencl/statistical/ZTest.", XLS); + ScDocument* pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + + ScDocShellRef xDocShRes = loadDoc("opencl/statistical/ZTest.", 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-192] void ScOpenclTest::testStatisticalFormulaBinomDist() { diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index 3e2088e47e4c..3c26e3a9fa06 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -1456,6 +1456,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r ) case ocStDev: case ocSlope: case ocSTEYX: + case ocZTest: // Don't change the state. break; default: |