diff options
Diffstat (limited to 'sc/qa')
-rw-r--r-- | sc/qa/unit/data/xls/opencl/math/sin.xls | bin | 0 -> 6656 bytes | |||
-rw-r--r-- | sc/qa/unit/opencl-test.cxx | 24 |
2 files changed, 24 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/opencl/math/sin.xls b/sc/qa/unit/data/xls/opencl/math/sin.xls Binary files differnew file mode 100644 index 000000000000..71ea0d1aedb3 --- /dev/null +++ b/sc/qa/unit/data/xls/opencl/math/sin.xls diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index de5bd74f9f53..415b99cabac2 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -125,6 +125,7 @@ public: void testMathFormulaSinh(); void testMathFormulaAbs(); void testFinacialPVFormula(); + void testMathFormulaSin(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -181,6 +182,7 @@ public: CPPUNIT_TEST(testMathFormulaSinh); CPPUNIT_TEST(testMathFormulaAbs); CPPUNIT_TEST(testFinacialPVFormula); + CPPUNIT_TEST(testMathFormulaSin); CPPUNIT_TEST_SUITE_END(); private: @@ -1173,6 +1175,28 @@ void ScOpenclTest::testStatisticalFormulaNegbinomdist() xDocSh->DoClose(); xDocShRes->DoClose(); } +//[AMLOEXT-58] +void ScOpenclTest::testMathFormulaSin() +{ + if (!detectOpenCLDevice()) + return; + ScDocShellRef xDocSh = loadDoc("opencl/math/sin.", XLS); + ScDocument* pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + ScDocShellRef xDocShRes = loadDoc("opencl/math/sin.", 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-63] void ScOpenclTest::testFinacialPriceFormula() { |