diff options
author | yangzhang <yangzhang@multicorewareinc.com> | 2013-11-10 09:20:22 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-11-14 20:30:42 -0600 |
commit | 2127b93fc8f9f306665c2f778761c7c60e2154fe (patch) | |
tree | 5a2fe80c91e3596edf9030b5988a66226ce03bc3 /sc | |
parent | 095c0d95b0906135d83588ac75d2925c7ae27f6d (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')
-rw-r--r-- | sc/qa/unit/data/ods/opencl/math/ArcTan2.ods | bin | 0 -> 59986 bytes | |||
-rw-r--r-- | sc/qa/unit/opencl-test.cxx | 29 | ||||
-rw-r--r-- | sc/source/core/tool/token.cxx | 1 |
3 files changed, 30 insertions, 0 deletions
diff --git a/sc/qa/unit/data/ods/opencl/math/ArcTan2.ods b/sc/qa/unit/data/ods/opencl/math/ArcTan2.ods Binary files differnew file mode 100644 index 000000000000..89f6bc56075e --- /dev/null +++ b/sc/qa/unit/data/ods/opencl/math/ArcTan2.ods 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() { diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index 94a4ff0d32a2..4d85db0ece32 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -1438,6 +1438,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r ) case ocMod: case ocTrunc: case ocSchiefe: + case ocArcTan2: // Don't change the state. break; default: |