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-31 17:36:49 -0600
commit9f2ebf896982ecd6fe065f77054256fb845fc049 (patch)
treef78078a8ac5c379084a5019109fc054de0ff16e4 /sc/qa/unit/opencl-test.cxx
parentf2ded26883b115b58e8350940a65a5abc8847229 (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> Signed-off-by: Wei Wei <weiwei@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" )
{