diff options
author | yangzhang <yangzhang@multicorewareinc.com> | 2013-11-07 12:47:03 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-11-13 17:44:11 -0600 |
commit | de08508db3d7785aa72be55268514708497fc7d3 (patch) | |
tree | 69c902b7bdab9dd62a8377d0b80bb038dc0149ab /sc | |
parent | 44b2e2f6b6d2f11829b0d98de7606ee01ec17cac (diff) |
GPU Calc: unit test cases for ATAN
Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test
AMLOEXT-144 BUG
Change-Id: I2e0664cdd9a557666652fcf5d77dac2d93a0aa79
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/ArcTan.ods | bin | 0 -> 45658 bytes | |||
-rw-r--r-- | sc/qa/unit/opencl-test.cxx | 27 | ||||
-rw-r--r-- | sc/source/core/tool/token.cxx | 1 |
3 files changed, 28 insertions, 0 deletions
diff --git a/sc/qa/unit/data/ods/opencl/math/ArcTan.ods b/sc/qa/unit/data/ods/opencl/math/ArcTan.ods Binary files differnew file mode 100644 index 000000000000..70737f86ade7 --- /dev/null +++ b/sc/qa/unit/data/ods/opencl/math/ArcTan.ods diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index 8fa9117eb549..9e73d7341ccc 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -170,6 +170,7 @@ public: void testMathFormulaArcCotHyp(); void testMathFormulaArcSin(); void testMathFormulaArcSinHyp(); + void testMathFormulaArcTan(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -271,6 +272,7 @@ public: CPPUNIT_TEST(testMathFormulaArcCotHyp); CPPUNIT_TEST(testMathFormulaArcSin); CPPUNIT_TEST(testMathFormulaArcSinHyp); + CPPUNIT_TEST(testMathFormulaArcTan); CPPUNIT_TEST_SUITE_END(); private: @@ -2910,6 +2912,31 @@ void ScOpenclTest::testMathFormulaArcSinHyp() xDocSh->DoClose(); xDocShRes->DoClose(); } +//[AMLOEXT-144] +void ScOpenclTest::testMathFormulaArcTan() +{ + if (!detectOpenCLDevice()) + return; + ScDocShellRef xDocSh = + loadDoc("opencl/math/ArcTan.", ODS); + ScDocument* pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + ScDocShellRef xDocShRes = + loadDoc("opencl/math/ArcTan.", ODS); + ScDocument* pDocRes = xDocShRes->GetDocument(); + CPPUNIT_ASSERT(pDocRes); + // Verify ATan 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(); +} ScOpenclTest::ScOpenclTest() : ScBootstrapFixture( "/sc/qa/unit/data" ) { diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index 9265db094182..af67716b770a 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -1404,6 +1404,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r ) case ocArcCotHyp: case ocArcSin: case ocArcSinHyp: + case ocArcTan: // Don't change the state. break; default: |