summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormulei <mulei@multicorewareinc.com>2013-12-16 11:58:09 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-12-19 17:54:02 -0600
commite8036abfc00a34d47f638437035b61bfabf81477 (patch)
tree686038e200e564b835ad17b2e30adb221e1be7f0
parentc46a3b6c78e56b64f1c36a257143abded69af370 (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>
-rw-r--r--sc/qa/unit/data/ods/opencl/math/sech.odsbin0 -> 12092 bytes
-rw-r--r--sc/qa/unit/opencl-test.cxx25
-rw-r--r--sc/source/core/tool/token.cxx1
3 files changed, 26 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
new file mode 100644
index 000000000000..a50c2e974fbe
--- /dev/null
+++ b/sc/qa/unit/data/ods/opencl/math/sech.ods
Binary files differ
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" )
{
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 4db7144fd05c..a7b95e5fbda4 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -1503,6 +1503,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocStDevA:
case ocStDevPA:
case ocSecant:
+ case ocSecantHyp:
// Don't change the state.
break;
default: