summaryrefslogtreecommitdiff
path: root/sc/qa/unit/opencl-test.cxx
diff options
context:
space:
mode:
authorshiming zhang <shiming@multicorewareinc.com>2013-12-18 15:46:56 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-12-19 17:54:06 -0600
commit838653741c1c5f59725dbdcd0c0a833ebd1db7c9 (patch)
tree48f46b39b087bd00e7d5cc8df025f465a0113839 /sc/qa/unit/opencl-test.cxx
parentafcf84daa01a547db37b20bfc613297936fa65b6 (diff)
GPU Calc: unit test cases for besselj
Turn NO_FALLBACK_TO_SWINTERP on in formulagroupcl.cxx for test AMLOEXT-378 BUG Change-Id: I1cbc041e1aa1899fa10931e7bfc3f8c8b43066f6 Signed-off-by: haochen <haochen@multicorewareinc.com> Signed-off-by: I-Jui (Ray) Sung <ray@multicorewareinc.com>
Diffstat (limited to 'sc/qa/unit/opencl-test.cxx')
-rw-r--r--sc/qa/unit/opencl-test.cxx27
1 files changed, 27 insertions, 0 deletions
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index 65528df6c3b5..3a1267417e2b 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -283,6 +283,7 @@ public:
void testMathFormulaSeriesSum();
void testMathFormulaQuotient();
void testMathFormulaSumIf();
+ void testAddInFormulaBesseLJ();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -496,6 +497,7 @@ public:
CPPUNIT_TEST(testMathFormulaQuotient);
CPPUNIT_TEST(testMathFormulaSeriesSum);
CPPUNIT_TEST(testMathFormulaSumIf);
+ CPPUNIT_TEST(testAddInFormulaBesseLJ);
CPPUNIT_TEST_SUITE_END();
private:
@@ -5861,6 +5863,31 @@ void ScOpenclTest::testMathFormulaSumIf()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-378]
+void ScOpenclTest::testAddInFormulaBesseLJ()
+{
+ if (!detectOpenCLDevice())
+ return;
+
+ ScDocShellRef xDocSh = loadDoc("opencl/addin/besselj.", XLS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+
+ ScDocShellRef xDocShRes = loadDoc("opencl/addin/besselj.", 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(2,i,0));
+ double fExcel = pDocRes->GetValue(ScAddress(2,i,0));
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
+ }
+ xDocSh->DoClose();
+ xDocShRes->DoClose();
+}
ScOpenclTest::ScOpenclTest()
: ScBootstrapFixture( "/sc/qa/unit/data" )
{