diff options
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/unit/data/xls/opencl/math/convert.xls | bin | 0 -> 24576 bytes | |||
-rw-r--r-- | sc/qa/unit/opencl-test.cxx | 25 |
2 files changed, 24 insertions, 1 deletions
diff --git a/sc/qa/unit/data/xls/opencl/math/convert.xls b/sc/qa/unit/data/xls/opencl/math/convert.xls Binary files differnew file mode 100644 index 000000000000..4e2f2061d535 --- /dev/null +++ b/sc/qa/unit/data/xls/opencl/math/convert.xls diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index 0fda4f88617a..c4d028e7bfe3 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -227,6 +227,7 @@ public: void testStatisticalFormulaZTest(); void testMathFormulaPi(); void testMathFormulaRandom(); + void testMathFormulaConvert(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -385,6 +386,7 @@ public: CPPUNIT_TEST(testStatisticalFormulaZTest); CPPUNIT_TEST(testMathFormulaPi); CPPUNIT_TEST(testMathFormulaRandom); + CPPUNIT_TEST(testMathFormulaConvert); CPPUNIT_TEST_SUITE_END(); private: @@ -4058,7 +4060,28 @@ void ScOpenclTest::testStatisticalFormulaChiInv() xDocSh->DoClose(); xDocShRes->DoClose(); } - +//[AMLOEXT-175] +void ScOpenclTest::testMathFormulaConvert() +{ + if (!detectOpenCLDevice()) + return; + ScDocShellRef xDocSh = loadDoc("opencl/math/convert.", XLS); + ScDocument* pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + ScDocShellRef xDocShRes = loadDoc("opencl/math/convert.", XLS); + ScDocument* pDocRes = xDocShRes->GetDocument(); + CPPUNIT_ASSERT(pDocRes); + for (SCROW i = 0; i <= 3; ++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-176 ] void ScOpenclTest::testMathCountIfsFormula() { |