diff options
author | zhenyu yuan <zhenyuyuan@multicorewareinc.com> | 2013-11-12 15:23:10 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-11-15 11:54:28 -0600 |
commit | 76a4dd60c5ce938508e4f44d8473aa0c3a0c58ed (patch) | |
tree | 33a8a662d5e45abfa809d40c555d25b37c239c36 /sc/qa | |
parent | 0115152dacd10bc4029c585f6fe55bb7695f04ab (diff) |
GPU Calc: unit test cases for PI
Need to turn on NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test
AMLOEXT-196 BUG
Change-Id: Ia60cb2739ea6485e31c4f81b7813798ba97a99f9
Signed-off-by: haochen <haochen@multicorewareinc.com>
Signed-off-by: I-Jui (Ray) Sung <ray@multicorewareinc.com>
Diffstat (limited to 'sc/qa')
-rw-r--r-- | sc/qa/unit/data/xls/opencl/math/pi.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/pi.xls b/sc/qa/unit/data/xls/opencl/math/pi.xls Binary files differnew file mode 100644 index 000000000000..c0a824ddc447 --- /dev/null +++ b/sc/qa/unit/data/xls/opencl/math/pi.xls diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index d71f0ef5a1d0..967b03ec9f89 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -225,6 +225,7 @@ public: void testStatisticalFormulaSlope(); void testStatisticalFormulaSTEYX(); void testStatisticalFormulaZTest(); + void testMathFormulaPi(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -381,6 +382,7 @@ public: CPPUNIT_TEST(testStatisticalFormulaSlope); CPPUNIT_TEST(testStatisticalFormulaSTEYX); CPPUNIT_TEST(testStatisticalFormulaZTest); + CPPUNIT_TEST(testMathFormulaPi); CPPUNIT_TEST_SUITE_END(); private: @@ -695,7 +697,29 @@ void ScOpenclTest::testMathFormulaSinh() xDocSh->DoClose(); xDocShRes->DoClose(); } +//[AMLOEXT-196] +void ScOpenclTest::testMathFormulaPi() +{ + if (!detectOpenCLDevice()) + return; + ScDocShellRef xDocSh = loadDoc("opencl/math/pi.", XLS); + ScDocument* pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + ScDocShellRef xDocShRes = loadDoc("opencl/math/pi.", XLS); + ScDocument* pDocRes = xDocShRes->GetDocument(); + CPPUNIT_ASSERT(pDocRes); + for (SCROW i = 0; i <= 15; ++i) + { + double fLibre = pDoc->GetValue(ScAddress(0,i,0)); + double fExcel = pDocRes->GetValue(ScAddress(0,i,0)); + CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); + } + xDocSh->DoClose(); + xDocShRes->DoClose(); +} void ScOpenclTest::testFinacialFormula() { if (!detectOpenCLDevice()) |