diff options
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/unit/data/xls/opencl/math/even.xls | bin | 0 -> 6656 bytes | |||
-rw-r--r-- | sc/qa/unit/opencl-test.cxx | 26 | ||||
-rw-r--r-- | sc/source/core/tool/token.cxx | 1 |
3 files changed, 27 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/opencl/math/even.xls b/sc/qa/unit/data/xls/opencl/math/even.xls Binary files differnew file mode 100644 index 000000000000..b882d7ed3a71 --- /dev/null +++ b/sc/qa/unit/data/xls/opencl/math/even.xls diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index 549ab4e6724e..657da6a893be 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -201,6 +201,7 @@ public: void testMathAverageIfsFormula(); void testMathCountIfsFormula(); void testMathFormulaCombina(); + void testMathFormulaEven(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -333,6 +334,7 @@ public: CPPUNIT_TEST(testMathAverageIfsFormula); CPPUNIT_TEST(testMathCountIfsFormula); CPPUNIT_TEST(testMathFormulaCombina); + CPPUNIT_TEST(testMathFormulaEven); CPPUNIT_TEST_SUITE_END(); private: @@ -3559,6 +3561,30 @@ void ScOpenclTest::testStatisticalFormulaBetaDist() xDocSh->DoClose(); xDocShRes->DoClose(); } +//AMLOEXT-164 +void ScOpenclTest::testMathFormulaEven() +{ + if (!detectOpenCLDevice()) + return; + + ScDocShellRef xDocSh = loadDoc("opencl/math/even.", XLS); + ScDocument* pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + ScDocShellRef xDocShRes = loadDoc("opencl/math/even.", XLS); + ScDocument* pDocRes = xDocShRes->GetDocument(); + CPPUNIT_ASSERT(pDocRes); + for (SCROW i = 0; i <= 15; ++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-165] void ScOpenclTest::testMathFormulaExp() { diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index c90719cb8c97..2d4bdf0103ad 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -1433,6 +1433,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r ) case ocAverageIfs: case ocCountIfs: case ocKombin2: + case ocEven: // Don't change the state. break; default: |