diff options
author | mulei <mulei@multicorewareinc.com> | 2013-12-16 11:58:09 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-12-19 17:54:02 -0600 |
commit | e8036abfc00a34d47f638437035b61bfabf81477 (patch) | |
tree | 686038e200e564b835ad17b2e30adb221e1be7f0 /sc/qa | |
parent | c46a3b6c78e56b64f1c36a257143abded69af370 (diff) |
GPU Calc: unit test cases for SECH
Turn NO_FALLBACK_TO_SWINTERP on in formulagroupcl.cxx for test
AMLOEXT-368 BUG
Change-Id: Id0f42bb75da00791cc83ea660ffaae9843e76541
Signed-off-by: haochen <haochen@multicorewareinc.com>
Signed-off-by: Wei Wei <weiwei@multicorewareinc.com>
Signed-off-by: I-Jui (Ray) Sung <ray@multicorewareinc.com>
Diffstat (limited to 'sc/qa')
-rw-r--r-- | sc/qa/unit/data/ods/opencl/math/sech.ods | bin | 0 -> 12092 bytes | |||
-rw-r--r-- | sc/qa/unit/opencl-test.cxx | 25 |
2 files changed, 25 insertions, 0 deletions
diff --git a/sc/qa/unit/data/ods/opencl/math/sech.ods b/sc/qa/unit/data/ods/opencl/math/sech.ods Binary files differnew file mode 100644 index 000000000000..a50c2e974fbe --- /dev/null +++ b/sc/qa/unit/data/ods/opencl/math/sech.ods diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index b1dc898b2606..293a6fe721e7 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -278,6 +278,7 @@ public: void testStatisticalFormulaStDevA(); void testStatisticalFormulaStDevPA(); void testMathFormulaSEC(); + void testMathFormulaSECH(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -486,6 +487,7 @@ public: CPPUNIT_TEST(testStatisticalFormulaStDevA); CPPUNIT_TEST(testStatisticalFormulaStDevPA); CPPUNIT_TEST(testMathFormulaSEC); + CPPUNIT_TEST(testMathFormulaSECH); CPPUNIT_TEST_SUITE_END(); private: @@ -5736,6 +5738,29 @@ void ScOpenclTest::testMathFormulaSEC() xDocSh->DoClose(); xDocShRes->DoClose(); } +//AMLOEXT-368 +void ScOpenclTest::testMathFormulaSECH() +{ + if (!detectOpenCLDevice()) + return; + + ScDocShellRef xDocSh = loadDoc("opencl/math/sech.", ODS); + ScDocument* pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + ScDocShellRef xDocShRes = loadDoc("opencl/math/sech.", ODS); + ScDocument* pDocRes = xDocShRes->GetDocument(); + CPPUNIT_ASSERT(pDocRes); + for (SCROW i = 0; i <= 15; ++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(); +} ScOpenclTest::ScOpenclTest() : ScBootstrapFixture( "/sc/qa/unit/data" ) { |