diff options
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/unit/data/xls/opencl/math/odd.xls | bin | 0 -> 19968 bytes | |||
-rw-r--r-- | sc/qa/unit/opencl-test.cxx | 24 | ||||
-rw-r--r-- | sc/source/core/tool/token.cxx | 1 |
3 files changed, 25 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/opencl/math/odd.xls b/sc/qa/unit/data/xls/opencl/math/odd.xls Binary files differnew file mode 100644 index 000000000000..95adbcf0939d --- /dev/null +++ b/sc/qa/unit/data/xls/opencl/math/odd.xls diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index b5427bb78bbc..7ebbb27db569 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -185,6 +185,7 @@ public: void testStatisticalFormulaVar(); void testStatisticalFormulaChiDist(); void testMathFormulaPower(); + void testMathFormulaOdd(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -301,6 +302,7 @@ public: CPPUNIT_TEST(testStatisticalFormulaVar); CPPUNIT_TEST(testStatisticalFormulaChiDist); CPPUNIT_TEST(testMathFormulaPower); + CPPUNIT_TEST(testMathFormulaOdd); CPPUNIT_TEST_SUITE_END(); private: @@ -3202,6 +3204,28 @@ void ScOpenclTest::testMathFormulaBitAnd() xDocSh->DoClose(); xDocShRes->DoClose(); } +//[AMLOEXT-153] +void ScOpenclTest::testMathFormulaOdd() +{ + if (!detectOpenCLDevice()) + return; + ScDocShellRef xDocSh = loadDoc("opencl/math/odd.", XLS); + ScDocument* pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + ScDocShellRef xDocShRes = loadDoc("opencl/math/odd.", 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-154] void ScOpenclTest::testMathFormulaLN() { diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index 5c656520bcc5..3a099e1e28a1 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -1418,6 +1418,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r ) case ocVar: case ocChiDist: case ocPower: + case ocOdd: // Don't change the state. break; default: |