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

GPU Calc: unit test cases for BITRSHFIT

Need to enable NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test

AMLOEXT-168 BUG

Change-Id: Id7c8b783b44915b4410bba500e520ff48b9f3a1f
Signed-off-by: 's avatarhaochen <haochen@multicorewareinc.com>
Signed-off-by: 's avatarI-Jui (Ray) Sung <ray@multicorewareinc.com>
üst a9d49e21
......@@ -209,6 +209,7 @@ public:
void testMathFormulaArcTan2();
void testMathFormulaBitOr();
void testMathFormulaBitLshift();
void testMathFormulaBitRshift();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
......@@ -349,6 +350,7 @@ public:
CPPUNIT_TEST(testMathFormulaArcTan2);
CPPUNIT_TEST(testMathFormulaBitOr);
CPPUNIT_TEST(testMathFormulaBitLshift);
CPPUNIT_TEST(testMathFormulaBitRshift);
CPPUNIT_TEST_SUITE_END();
private:
......@@ -3790,6 +3792,29 @@ void ScOpenclTest::testMathFormulaBitLshift()
xDocSh->DoClose();
xDocShRes->DoClose();
}
//[AMLOEXT-168]
void ScOpenclTest::testMathFormulaBitRshift()
{
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/BitRshift.", ODS);
ScDocument* pDoc = xDocSh->GetDocument();
CPPUNIT_ASSERT(pDoc);
enableOpenCL();
pDoc->CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/BitRshift.", ODS);
ScDocument* pDocRes = xDocShRes->GetDocument();
CPPUNIT_ASSERT(pDocRes);
// Verify BitRshift Function
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));
}
xDocSh->DoClose();
xDocShRes->DoClose();
}
//[AMLOEXT-169]
void ScOpenclTest::testMathFormulaFloor()
{
......
......@@ -1441,6 +1441,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocArcTan2:
case ocBitOr:
case ocBitLshift:
case ocBitRshift:
// 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