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

GPU Calc: unit test cases for AND

Turn NO_FALLBACK_TO_SWINTERP on  in formulagroupcl.cxx for test

AMLOEXT-217 BUG

Change-Id: I768e3b58e37d56c527f364aab54b88ecfe8c0907
Signed-off-by: 's avatarhaochen <haochen@multicorewareinc.com>
Signed-off-by: 's avatarI-Jui (Ray) Sung <ray@multicorewareinc.com>
üst 26c759b7
......@@ -239,6 +239,7 @@ public:
void testArrayFormulaSumXMY2();
void testStatisticalFormulaStDevP();
void testStatisticalFormulaCovar();
void testLogicalFormulaAnd();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
......@@ -409,6 +410,7 @@ public:
CPPUNIT_TEST(testArrayFormulaSumXMY2);
CPPUNIT_TEST(testStatisticalFormulaStDevP);
CPPUNIT_TEST(testStatisticalFormulaCovar);
CPPUNIT_TEST(testLogicalFormulaAnd);
CPPUNIT_TEST_SUITE_END();
private:
......@@ -4712,6 +4714,34 @@ void ScOpenclTest:: testArrayFormulaSumXMY2()
xDocSh->DoClose();
xDocShRes->DoClose();
}
//[AMLOEXT-217]
void ScOpenclTest:: testLogicalFormulaAnd()
{
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/logical/and.", XLS);
ScDocument *pDoc = xDocSh->GetDocument();
CPPUNIT_ASSERT(pDoc);
enableOpenCL();
pDoc->CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/logical/and.", XLS);
ScDocument *pDocRes = xDocShRes->GetDocument();
CPPUNIT_ASSERT(pDocRes);
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));
}
for (SCROW i = 1; i <= 20; ++i)
{
double fLibre = pDoc->GetValue(ScAddress(3, i, 0));
double fExcel = pDocRes->GetValue(ScAddress(3, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
xDocShRes->DoClose();
}
ScOpenclTest::ScOpenclTest()
: ScBootstrapFixture( "/sc/qa/unit/data" )
{
......
......@@ -1470,6 +1470,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocSumXMY2:
case ocStDevP:
case ocCovar:
case ocAnd:
// Don't change the state.
break;
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