diff options
-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: |