Kaydet (Commit) 975e946f authored tarafından yangzhang's avatar yangzhang Kaydeden (comit) I-Jui (Ray) Sung

GPU Calc: unit test cases for BITAND

Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test

AMLOEXT-149 BUG

Change-Id: Iad20b76cc627768421bb3523388deeaa3584439e
Signed-off-by: 's avatarhaochen <haochen@multicorewareinc.com>
Signed-off-by: 's avatarI-Jui (Ray) Sung <ray@multicorewareinc.com>
üst d767355e
......@@ -172,6 +172,7 @@ public:
void testMathFormulaArcSinHyp();
void testMathFormulaArcTan();
void testMathFormulaArcTanHyp();
void testMathFormulaBitAnd();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
......@@ -275,6 +276,7 @@ public:
CPPUNIT_TEST(testMathFormulaArcSinHyp);
CPPUNIT_TEST(testMathFormulaArcTan);
CPPUNIT_TEST(testMathFormulaArcTanHyp);
CPPUNIT_TEST(testMathFormulaBitAnd);
CPPUNIT_TEST_SUITE_END();
private:
......@@ -2964,6 +2966,31 @@ void ScOpenclTest::testMathFormulaArcTanHyp()
xDocSh->DoClose();
xDocShRes->DoClose();
}
//[AMLOEXT-149]
void ScOpenclTest::testMathFormulaBitAnd()
{
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh =
loadDoc("opencl/math/BitAnd.", ODS);
ScDocument* pDoc = xDocSh->GetDocument();
CPPUNIT_ASSERT(pDoc);
enableOpenCL();
pDoc->CalcAll();
ScDocShellRef xDocShRes =
loadDoc("opencl/math/BitAnd.", ODS);
ScDocument* pDocRes = xDocShRes->GetDocument();
CPPUNIT_ASSERT(pDocRes);
// Verify BitAnd Function
for (SCROW i = 1; i <= 1000; ++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));
}
xDocSh->DoClose();
xDocShRes->DoClose();
}
ScOpenclTest::ScOpenclTest()
: ScBootstrapFixture( "/sc/qa/unit/data" )
{
......
......@@ -1406,6 +1406,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocArcSinHyp:
case ocArcTan:
case ocArcTanHyp:
case ocBitAnd:
// 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