summaryrefslogtreecommitdiff
path: root/sc/qa
diff options
context:
space:
mode:
authordechuang <dechuang@multicorewareinc.com>2013-11-08 08:58:33 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-11-14 14:09:43 -0600
commit99910c63f77be475eb8481825ec38c74c6873e52 (patch)
tree393ccf6aa5492cc35fdc11810942c27325c7cc36 /sc/qa
parenta115ee4c3540bc7b16bb5ef2362c85e88e2d2e27 (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.odsbin0 -> 12184 bytes
-rw-r--r--sc/qa/unit/opencl-test.cxx24
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
new file mode 100644
index 000000000000..7f797703ad1a
--- /dev/null
+++ b/sc/qa/unit/data/ods/opencl/math/power.ods
Binary files differ
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()
{