summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authoryangzhang <yangzhang@multicorewareinc.com>2013-11-07 11:26:44 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-11-13 17:44:10 -0600
commita07929c479200f9c600845d7078183581a5d23d7 (patch)
treec4528464a64b459cb32f3ab7f90edbf1fc1f68c4 /sc
parent6d5ee68763f94e699089242bd05dfe2f519d9d3c (diff)
GPU Calc: unit test cases for ASIN
Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test AMLOEXT-130 BUG Change-Id: I964d15fc3b864d2c392d3b1dcb22153eb057ff5b 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/ods/opencl/math/ArcSin.odsbin0 -> 44706 bytes
-rw-r--r--sc/qa/unit/opencl-test.cxx27
-rw-r--r--sc/source/core/tool/token.cxx1
3 files changed, 28 insertions, 0 deletions
diff --git a/sc/qa/unit/data/ods/opencl/math/ArcSin.ods b/sc/qa/unit/data/ods/opencl/math/ArcSin.ods
new file mode 100644
index 000000000000..3c29e33b05ae
--- /dev/null
+++ b/sc/qa/unit/data/ods/opencl/math/ArcSin.ods
Binary files differ
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index 5fc4060f969b..50f41f1d84cc 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -168,6 +168,7 @@ public:
void testMathFormulaCosh();
void testStatisticalFormulaCritBinom();
void testMathFormulaArcCotHyp();
+ void testMathFormulaArcSin();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -267,6 +268,7 @@ public:
CPPUNIT_TEST(testMathFormulaCosh);
CPPUNIT_TEST(testStatisticalFormulaCritBinom);
CPPUNIT_TEST(testMathFormulaArcCotHyp);
+ CPPUNIT_TEST(testMathFormulaArcSin);
CPPUNIT_TEST_SUITE_END();
private:
@@ -2678,6 +2680,31 @@ void ScOpenclTest::testMathFormulaArcCotHyp()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-130]
+void ScOpenclTest::testMathFormulaArcSin()
+{
+ if (!detectOpenCLDevice())
+ return;
+ ScDocShellRef xDocSh =
+ loadDoc("opencl/math/ArcSin.", ODS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes =
+ loadDoc("opencl/math/ArcSin.", ODS);
+ ScDocument* pDocRes = xDocShRes->GetDocument();
+ CPPUNIT_ASSERT(pDocRes);
+ // Verify ACotH Function
+ for (SCROW i = 1; i <= 1000; ++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-133]
void ScOpenclTest:: testFinancialVDBFormula()
{
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index a350e02eb14d..56f9433a7cce 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -1402,6 +1402,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocCosHyp:
case ocKritBinom:
case ocArcCotHyp:
+ case ocArcSin:
// Don't change the state.
break;
default: