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

GPU Calc: unit test cases for NOT

Need turn NO_FALLBACK_TO_SWINTERP on  in formulagroupcl.cxx for test

AMLOEXT-267 BUG

Change-Id: I5d438b79df9af1f59645cbcbc84811bfc4055bd3
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 957fefd8
...@@ -246,6 +246,7 @@ public: ...@@ -246,6 +246,7 @@ public:
void testMathFormulaSumProduct2(); void testMathFormulaSumProduct2();
void testStatisticalParallelCountBug(); void testStatisticalParallelCountBug();
void testSpreadSheetFormulaVLookup(); void testSpreadSheetFormulaVLookup();
void testLogicalFormulaNot();
CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula); CPPUNIT_TEST(testFinacialFormula);
...@@ -423,6 +424,7 @@ public: ...@@ -423,6 +424,7 @@ public:
CPPUNIT_TEST(testStatisticalParallelCountBug); CPPUNIT_TEST(testStatisticalParallelCountBug);
CPPUNIT_TEST(testSpreadSheetFormulaVLookup); CPPUNIT_TEST(testSpreadSheetFormulaVLookup);
CPPUNIT_TEST(testLogicalFormulaOr); CPPUNIT_TEST(testLogicalFormulaOr);
CPPUNIT_TEST(testLogicalFormulaNot);
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
private: private:
...@@ -4926,6 +4928,28 @@ void ScOpenclTest:: testLogicalFormulaOr() ...@@ -4926,6 +4928,28 @@ void ScOpenclTest:: testLogicalFormulaOr()
xDocSh->DoClose(); xDocSh->DoClose();
xDocShRes->DoClose(); xDocShRes->DoClose();
} }
//[AMLOEXT-267]
void ScOpenclTest:: testLogicalFormulaNot()
{
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/logical/not.", XLS);
ScDocument *pDoc = xDocSh->GetDocument();
CPPUNIT_ASSERT(pDoc);
enableOpenCL();
pDoc->CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/logical/not.", 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" )
{ {
......
...@@ -1474,6 +1474,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r ) ...@@ -1474,6 +1474,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocCovar: case ocCovar:
case ocAnd: case ocAnd:
case ocOr: case ocOr:
case ocNot:
// 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