Kaydet (Commit) de0013f6 authored tarafından minwang's avatar minwang Kaydeden (comit) I-Jui (Ray) Sung

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: 's avatarhaochen <haochen@multicorewareinc.com>
Signed-off-by: 's avatarWei Wei <weiwei@multicorewareinc.com>
Signed-off-by: 's avatarI-Jui (Ray) Sung <ray@multicorewareinc.com>
üst 4ea6b93c
...@@ -247,6 +247,7 @@ public: ...@@ -247,6 +247,7 @@ public:
void testStatisticalParallelCountBug(); void testStatisticalParallelCountBug();
void testSpreadSheetFormulaVLookup(); void testSpreadSheetFormulaVLookup();
void testLogicalFormulaNot(); void testLogicalFormulaNot();
void testLogicalFormulaXor();
CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula); CPPUNIT_TEST(testFinacialFormula);
...@@ -425,6 +426,7 @@ public: ...@@ -425,6 +426,7 @@ public:
CPPUNIT_TEST(testSpreadSheetFormulaVLookup); CPPUNIT_TEST(testSpreadSheetFormulaVLookup);
CPPUNIT_TEST(testLogicalFormulaOr); CPPUNIT_TEST(testLogicalFormulaOr);
CPPUNIT_TEST(testLogicalFormulaNot); CPPUNIT_TEST(testLogicalFormulaNot);
CPPUNIT_TEST(testLogicalFormulaXor);
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
private: private:
...@@ -4950,6 +4952,28 @@ void ScOpenclTest:: testLogicalFormulaNot() ...@@ -4950,6 +4952,28 @@ void ScOpenclTest:: testLogicalFormulaNot()
xDocSh->DoClose(); xDocSh->DoClose();
xDocShRes->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() ScOpenclTest::ScOpenclTest()
: ScBootstrapFixture( "/sc/qa/unit/data" ) : ScBootstrapFixture( "/sc/qa/unit/data" )
{ {
......
...@@ -1475,6 +1475,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r ) ...@@ -1475,6 +1475,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocAnd: case ocAnd:
case ocOr: case ocOr:
case ocNot: case ocNot:
case ocXor:
// Don't change the state. // Don't change the state.
break; break;
default: default:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment