summaryrefslogtreecommitdiff
path: root/sc/qa/unit/opencl-test.cxx
diff options
context:
space:
mode:
authoryangzhang <yangzhang@multicorewareinc.com>2013-11-10 09:20:22 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-11-14 20:30:42 -0600
commit2127b93fc8f9f306665c2f778761c7c60e2154fe (patch)
tree5a2fe80c91e3596edf9030b5988a66226ce03bc3 /sc/qa/unit/opencl-test.cxx
parent095c0d95b0906135d83588ac75d2925c7ae27f6d (diff)
GPU Calc: unit test cases for ATAN2
Need to turn on NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test AMLOEXT-174 BUG Change-Id: I83e5d89079eb8f1dd315d23888e4d7058f48bcae Signed-off-by: haochen <haochen@multicorewareinc.com> Signed-off-by: I-Jui (Ray) Sung <ray@multicorewareinc.com>
Diffstat (limited to 'sc/qa/unit/opencl-test.cxx')
-rw-r--r--sc/qa/unit/opencl-test.cxx29
1 files changed, 29 insertions, 0 deletions
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index ed13362dd49f..e33599ef4914 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -206,6 +206,7 @@ public:
void testMathFormulaMod();
void testMathFormulaTrunc();
void testStatisticalFormulaSkew();
+ void testMathFormulaArcTan2();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -343,6 +344,7 @@ public:
CPPUNIT_TEST(testMathFormulaMod);
CPPUNIT_TEST(testMathFormulaTrunc);
CPPUNIT_TEST(testStatisticalFormulaSkew);
+ CPPUNIT_TEST(testMathFormulaArcTan2);
CPPUNIT_TEST_SUITE_END();
private:
@@ -3317,6 +3319,33 @@ void ScOpenclTest:: testFinacialNPER1Formula()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-147]
+void ScOpenclTest::testMathFormulaArcTan2()
+{
+ if (!detectOpenCLDevice())
+ return;
+ ScDocShellRef xDocSh =
+ loadDoc("opencl/math/ArcTan2.", ODS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes =
+ loadDoc("opencl/math/ArcTan2.", ODS);
+ ScDocument* pDocRes = xDocShRes->GetDocument();
+ CPPUNIT_ASSERT(pDocRes);
+ // Verify ATan2 Function
+ for (SCROW i = 1; i <= 17; ++i)
+ {
+ double fLibre = pDoc->GetValue(ScAddress(2,i,0));
+ double fExcel = pDocRes->GetValue(ScAddress(2,i,0));
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, 0.000001);
+ }
+ xDocSh->DoClose();
+ xDocShRes->DoClose();
+}
+
+
//[AMLOEXT-148]
void ScOpenclTest::testStatisticalFormulaChiSqInv()
{