diff options
author | minwang <min@multicorewareinc.com> | 2013-12-05 09:06:17 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-12-18 20:34:57 -0600 |
commit | de0013f64ad18f93dc175bdf3843aec1cfa102cb (patch) | |
tree | 69b6ca8f4aeddae070d9169b512ef1933accf63f | |
parent | 4ea6b93c0ffec54f5aa8e742acba06a09276dae1 (diff) |
GPU Calc: unit test cases for XOR
Need turn NO_FALLBACK_TO_SWINTERP on in formulagroupcl.cxx for test
AMLOEXT-272 BUG
Signed-off-by: haochen <haochen@multicorewareinc.com>
Signed-off-by: Wei Wei <weiwei@multicorewareinc.com>
Signed-off-by: I-Jui (Ray) Sung <ray@multicorewareinc.com>
-rw-r--r-- | sc/qa/unit/data/xls/opencl/logical/xor.xls | bin | 0 -> 3285504 bytes | |||
-rw-r--r-- | sc/qa/unit/opencl-test.cxx | 24 | ||||
-rw-r--r-- | sc/source/core/tool/token.cxx | 1 |
3 files changed, 25 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/opencl/logical/xor.xls b/sc/qa/unit/data/xls/opencl/logical/xor.xls Binary files differnew file mode 100644 index 000000000000..fccba9b19f1d --- /dev/null +++ b/sc/qa/unit/data/xls/opencl/logical/xor.xls diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index 45878446f8b1..7796b57a675a 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -247,6 +247,7 @@ public: void testStatisticalParallelCountBug(); void testSpreadSheetFormulaVLookup(); void testLogicalFormulaNot(); + void testLogicalFormulaXor(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -425,6 +426,7 @@ public: CPPUNIT_TEST(testSpreadSheetFormulaVLookup); CPPUNIT_TEST(testLogicalFormulaOr); CPPUNIT_TEST(testLogicalFormulaNot); + CPPUNIT_TEST(testLogicalFormulaXor); CPPUNIT_TEST_SUITE_END(); private: @@ -4950,6 +4952,28 @@ void ScOpenclTest:: testLogicalFormulaNot() xDocSh->DoClose(); xDocShRes->DoClose(); } +//[AMLOEXT-272] +void ScOpenclTest:: testLogicalFormulaXor() +{ + if (!detectOpenCLDevice()) + return; + ScDocShellRef xDocSh = loadDoc("opencl/logical/xor.", XLS); + ScDocument *pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + ScDocShellRef xDocShRes = loadDoc("opencl/logical/xor.", XLS); + ScDocument *pDocRes = xDocShRes->GetDocument(); + CPPUNIT_ASSERT(pDocRes); + for (SCROW i = 0; i < 30000; ++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 841719138a5a..860dbe2fd157 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -1475,6 +1475,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r ) case ocAnd: case ocOr: case ocNot: + case ocXor: // Don't change the state. break; default: |