diff options
author | shiming zhang <shiming@multicorewareinc.com> | 2013-12-18 15:46:56 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-12-19 17:54:06 -0600 |
commit | 838653741c1c5f59725dbdcd0c0a833ebd1db7c9 (patch) | |
tree | 48f46b39b087bd00e7d5cc8df025f465a0113839 | |
parent | afcf84daa01a547db37b20bfc613297936fa65b6 (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>
-rw-r--r-- | sc/qa/unit/data/xls/opencl/addin/besselj.xls | bin | 0 -> 7168 bytes | |||
-rw-r--r-- | sc/qa/unit/opencl-test.cxx | 27 |
2 files changed, 27 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/opencl/addin/besselj.xls b/sc/qa/unit/data/xls/opencl/addin/besselj.xls Binary files differnew file mode 100644 index 000000000000..ddee1a3c145b --- /dev/null +++ b/sc/qa/unit/data/xls/opencl/addin/besselj.xls 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" ) { |