summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authordechuang <dechuang@multicorewareinc.com>2013-11-04 14:23:11 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-11-04 00:58:55 -0600
commitcd4d44e5e8b540816ed7757e243f01256418b43e (patch)
tree5d810dc59406d02e21c0c371b72901a50ef97648 /sc
parent0e6a2601b39cbadaff7f7506ba9e804f108060db (diff)
GPU Calc: unit test cases for SINH
Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test AMLOEXT-116 BUG Change-Id: Ic3cf18c9b475bc37bdca40cb64c582742bba8a5a Signed-off-by: haochen <haochen@multicorewareinc.com> Signed-off-by: I-Jui (Ray) Sung <ray@multicorewareinc.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/unit/data/xls/opencl/math/sinh.xlsbin0 -> 19968 bytes
-rw-r--r--sc/qa/unit/opencl-test.cxx20
-rw-r--r--sc/source/core/tool/token.cxx1
3 files changed, 21 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/opencl/math/sinh.xls b/sc/qa/unit/data/xls/opencl/math/sinh.xls
new file mode 100644
index 000000000000..1a960b2a60fe
--- /dev/null
+++ b/sc/qa/unit/data/xls/opencl/math/sinh.xls
Binary files differ
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index 3d608947cefc..88232aa97085 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -122,6 +122,7 @@ public:
void testFinacialPriceFormula();
void testFinancialDurationFormula();
void testFinancialCoupnumFormula();
+ void testMathFormulaSinh();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -175,6 +176,7 @@ public:
CPPUNIT_TEST(testFinacialPriceFormula);
CPPUNIT_TEST(testFinancialDurationFormula);
CPPUNIT_TEST(testFinancialCoupnumFormula);
+ CPPUNIT_TEST(testMathFormulaSinh);
CPPUNIT_TEST_SUITE_END();
private:
@@ -471,6 +473,24 @@ void ScOpenclTest::testMathFormulaCos()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-116]
+void ScOpenclTest::testMathFormulaSinh()
+{
+ ScDocShellRef xDocSh = loadDoc("opencl/math/sinh.", XLS);
+ enableOpenCL(); ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc); xDocSh->DoHardRecalc(true);
+ ScDocShellRef xDocShRes = loadDoc("opencl/math/sinh.", XLS);
+ 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();
+}
void ScOpenclTest::testFinacialFormula()
{
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 5845c6355352..6333abbcb14e 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -1368,6 +1368,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocCosecantHyp:
case ocISPMT:
case ocLaufz:
+ case ocSinHyp:
// Don't change the state.
break;
default: