diff options
author | dechuang <dechuang@multicorewareinc.com> | 2013-11-08 08:58:33 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-11-14 14:09:43 -0600 |
commit | 99910c63f77be475eb8481825ec38c74c6873e52 (patch) | |
tree | 393ccf6aa5492cc35fdc11810942c27325c7cc36 /sc/qa | |
parent | a115ee4c3540bc7b16bb5ef2362c85e88e2d2e27 (diff) |
GPU Calc: unit test cases for POWER
Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test
AMLOEXT-117 BUG
Change-Id: I4bcfe78e88d92a806302a0d55f6207a48ee22080
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/ods/opencl/math/power.ods | bin | 0 -> 12184 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/ods/opencl/math/power.ods b/sc/qa/unit/data/ods/opencl/math/power.ods Binary files differnew file mode 100644 index 000000000000..7f797703ad1a --- /dev/null +++ b/sc/qa/unit/data/ods/opencl/math/power.ods diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index e6344aee6f29..b5427bb78bbc 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -184,6 +184,7 @@ public: void testStatisticalFormulaFDist(); void testStatisticalFormulaVar(); void testStatisticalFormulaChiDist(); + void testMathFormulaPower(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -299,6 +300,7 @@ public: CPPUNIT_TEST(testStatisticalFormulaFDist); CPPUNIT_TEST(testStatisticalFormulaVar); CPPUNIT_TEST(testStatisticalFormulaChiDist); + CPPUNIT_TEST(testMathFormulaPower); CPPUNIT_TEST_SUITE_END(); private: @@ -2515,6 +2517,28 @@ void ScOpenclTest::testMathFormulaArcCos() xDocSh->DoClose(); xDocShRes->DoClose(); } +//[AMLOEXT-117] +void ScOpenclTest::testMathFormulaPower() +{ + if (!detectOpenCLDevice()) + return; + ScDocShellRef xDocSh = loadDoc("opencl/math/power.", ODS); + ScDocument* pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + ScDocShellRef xDocShRes = loadDoc("opencl/math/power.", ODS); + ScDocument* pDocRes = xDocShRes->GetDocument(); + CPPUNIT_ASSERT(pDocRes); + for (SCROW i = 0; i <= 15; ++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(); +} //[AMLOEXT-119] void ScOpenclTest:: testFinacialPPMTFormula() { |