summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortianyao <tianyao@multicorewareinc.com>2013-11-09 12:04:30 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-11-14 14:09:49 -0600
commit2a3225899e8d98410d5f47c59aa4cd6fe911b9f6 (patch)
tree681c4a1a33d79179f4d8f66edbbfa43e57805ba3
parent02d28b8cca5f4ed635b003bce75d37bff18eed3a (diff)
GPU Calc: unit test cases for CSCH
Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test AMLOEXT-106 BUG Change-Id: Ic20019c3f8f823bc9107c42d2e5f27eff6418a3a Signed-off-by: haochen <haochen@multicorewareinc.com> Signed-off-by: I-Jui (Ray) Sung <ray@multicorewareinc.com>
-rw-r--r--sc/qa/unit/data/ods/opencl/math/csch.odsbin0 -> 12051 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/csch.ods b/sc/qa/unit/data/ods/opencl/math/csch.ods
new file mode 100644
index 000000000000..5a29cdc7ecd0
--- /dev/null
+++ b/sc/qa/unit/data/ods/opencl/math/csch.ods
Binary files differ
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index d3c073dbc47b..3412552316a6 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -194,6 +194,7 @@ public:
void testStatisticalFormulaFTest();
void testStatisticalFormulaB();
void testStatisticalFormulaBetaDist();
+ void testMathFormulaCscH();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -319,6 +320,7 @@ public:
CPPUNIT_TEST(testStatisticalFormulaFTest);
CPPUNIT_TEST(testStatisticalFormulaB);
CPPUNIT_TEST(testStatisticalFormulaBetaDist);
+ CPPUNIT_TEST(testMathFormulaCscH);
CPPUNIT_TEST_SUITE_END();
private:
@@ -2048,6 +2050,28 @@ void ScOpenclTest::testStatisticalFormulaPhi()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-106]
+void ScOpenclTest::testMathFormulaCscH()
+{
+ if (!detectOpenCLDevice())
+ return;
+ ScDocShellRef xDocSh = loadDoc("opencl/math/csch.", ODS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/math/csch.", 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();
+}
//[AMLOEXT-107]
void ScOpenclTest::testStatisticalFormulaLogInv()
{