summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryangzhang <yangzhang@multicorewareinc.com>2013-11-06 16:39:05 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-11-13 17:44:08 -0600
commit7db412400b24eec53b6030974551edbbb35ab89d (patch)
tree2af76540b2dd87e877411594b157c9883e02f79f
parentfa87dc52d756387cdc641d76062f0c3ce9bb22e0 (diff)
GPU Calc: unit test cases for ARCCOT
Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test AMLOEXT-127 BUG Change-Id: I2e44589b34da9a2491986b4f8ab075da7b01145a 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/ArcCot.odsbin0 -> 43843 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/ArcCot.ods b/sc/qa/unit/data/ods/opencl/math/ArcCot.ods
new file mode 100644
index 000000000000..171cb5f8d21e
--- /dev/null
+++ b/sc/qa/unit/data/ods/opencl/math/ArcCot.ods
Binary files differ
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index 6727012fe5a4..1613e94827b2 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -164,6 +164,7 @@ public:
void testFinancialCouppcdFormula();
void testFinancialCoupncdFormula();
void testStatisticalFormulaLogInv();
+ void testMathFormulaArcCot();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -259,6 +260,7 @@ public:
CPPUNIT_TEST(testFinancialCoupncdFormula);
CPPUNIT_TEST(testFinancialAccrintFormula);
CPPUNIT_TEST(testStatisticalFormulaLogInv);
+ CPPUNIT_TEST(testMathFormulaArcCot);
CPPUNIT_TEST_SUITE_END();
private:
@@ -2491,6 +2493,31 @@ void ScOpenclTest:: testFinancialMDurationFormula()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-127]
+void ScOpenclTest::testMathFormulaArcCot()
+{
+ if (!detectOpenCLDevice())
+ return;
+ ScDocShellRef xDocSh =
+ loadDoc("opencl/math/ArcCot.", ODS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes =
+ loadDoc("opencl/math/ArcCot.", ODS);
+ ScDocument* pDocRes = xDocShRes->GetDocument();
+ CPPUNIT_ASSERT(pDocRes);
+ // Verify ACot 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-131]
void ScOpenclTest:: testFinancialFVFormula()
{
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index e1aaa7bbc3e7..c948154da963 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -1398,6 +1398,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocIntercept:
case ocGDA2:
case ocLogInv:
+ case ocArcCot:
// Don't change the state.
break;
default: