diff options
author | yangzhang <yangzhang@multicorewareinc.com> | 2013-11-10 10:18:22 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-11-14 20:30:48 -0600 |
commit | ea652ae629103d4826c662cd0b0830617a3dac33 (patch) | |
tree | 632de276bab064cb2611847e8fae50955992c4ed | |
parent | a5349f2a504e1349a807456ecf16bc182c396143 (diff) |
GPU Calc: unit test cases for BITXOR
Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test
AMLOEXT-178 BUG
Change-Id: Iab8988244328ab9be2ccf0d69ee862c82cf05738
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/BitXor.ods | bin | 0 -> 13302 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/BitXor.ods b/sc/qa/unit/data/ods/opencl/math/BitXor.ods Binary files differnew file mode 100644 index 000000000000..c8e812a2e832 --- /dev/null +++ b/sc/qa/unit/data/ods/opencl/math/BitXor.ods diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index 763a80c172df..ca5913c811ca 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -210,6 +210,7 @@ public: void testMathFormulaBitOr(); void testMathFormulaBitLshift(); void testMathFormulaBitRshift(); + void testMathFormulaBitXor(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -351,6 +352,7 @@ public: CPPUNIT_TEST(testMathFormulaBitOr); CPPUNIT_TEST(testMathFormulaBitLshift); CPPUNIT_TEST(testMathFormulaBitRshift); + CPPUNIT_TEST(testMathFormulaBitXor); CPPUNIT_TEST_SUITE_END(); private: @@ -3883,6 +3885,29 @@ void ScOpenclTest::testMathCountIfsFormula() xDocSh->DoClose(); xDocShRes->DoClose(); } +//[AMLOEXT-178] +void ScOpenclTest::testMathFormulaBitXor() +{ + if (!detectOpenCLDevice()) + return; + ScDocShellRef xDocSh = loadDoc("opencl/math/BitXor.", ODS); + ScDocument* pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + ScDocShellRef xDocShRes = loadDoc("opencl/math/BitXor.", ODS); + ScDocument* pDocRes = xDocShRes->GetDocument(); + CPPUNIT_ASSERT(pDocRes); + // Verify BitXor 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-179] void ScOpenclTest::testMathAverageIfsFormula() { diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index f0d2d7caee97..21b5bcc837d6 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -1442,6 +1442,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r ) case ocBitOr: case ocBitLshift: case ocBitRshift: + case ocBitXor: // Don't change the state. break; default: |