diff options
author | yangzhang <yangzhang@multicorewareinc.com> | 2013-11-10 09:52:22 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-11-14 20:30:45 -0600 |
commit | 0f08b857c9dd01809286f78375d6195f8da85323 (patch) | |
tree | 03df68f9156dc92bceca50a40afdd6854139742d | |
parent | f928820af4234725c98dd82e997ead2b1966a0dc (diff) |
GPU Calc: unit test cases for BITLSHFIT
Need to turn on NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test
AMLOEXT-167 BUG
Change-Id: Id20ca1ee503f593460b99d9701c77c5c63d9d845
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/BitLshift.ods | bin | 0 -> 13975 bytes | |||
-rw-r--r-- | sc/qa/unit/opencl-test.cxx | 25 | ||||
-rw-r--r-- | sc/source/core/tool/token.cxx | 1 |
3 files changed, 26 insertions, 0 deletions
diff --git a/sc/qa/unit/data/ods/opencl/math/BitLshift.ods b/sc/qa/unit/data/ods/opencl/math/BitLshift.ods Binary files differnew file mode 100644 index 000000000000..e1ebd4a81650 --- /dev/null +++ b/sc/qa/unit/data/ods/opencl/math/BitLshift.ods diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index 9ee6b1b5bc78..ff650658bb29 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -208,6 +208,7 @@ public: void testStatisticalFormulaSkew(); void testMathFormulaArcTan2(); void testMathFormulaBitOr(); + void testMathFormulaBitLshift(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -347,6 +348,7 @@ public: CPPUNIT_TEST(testStatisticalFormulaSkew); CPPUNIT_TEST(testMathFormulaArcTan2); CPPUNIT_TEST(testMathFormulaBitOr); + CPPUNIT_TEST(testMathFormulaBitLshift); CPPUNIT_TEST_SUITE_END(); private: @@ -3765,6 +3767,29 @@ void ScOpenclTest::testStatisticalFormulaChiDist() xDocSh->DoClose(); xDocShRes->DoClose(); } +//[AMLOEXT-167] +void ScOpenclTest::testMathFormulaBitLshift() +{ + if (!detectOpenCLDevice()) + return; + ScDocShellRef xDocSh = loadDoc("opencl/math/BitLshift.", ODS); + ScDocument* pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + ScDocShellRef xDocShRes = loadDoc("opencl/math/BitLshift.", ODS); + ScDocument* pDocRes = xDocShRes->GetDocument(); + CPPUNIT_ASSERT(pDocRes); + // Verify BitLshift Function + for (SCROW i = 1; i <= 20; ++i) + { + double fLibre = pDoc->GetValue(ScAddress(2,i,0)); + double fExcel = pDocRes->GetValue(ScAddress(2,i,0)); + CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); + } + xDocSh->DoClose(); + xDocShRes->DoClose(); +} //[AMLOEXT-169] void ScOpenclTest::testMathFormulaFloor() { diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index 0f22c973556e..c1c9e89a2b3d 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -1440,6 +1440,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r ) case ocSchiefe: case ocArcTan2: case ocBitOr: + case ocBitLshift: // Don't change the state. break; default: |