summaryrefslogtreecommitdiff
path: root/sc/qa/unit/opencl-test.cxx
diff options
context:
space:
mode:
authoryangzhang <yangzhang@multicorewareinc.com>2013-11-10 09:52:22 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-11-14 20:30:45 -0600
commit0f08b857c9dd01809286f78375d6195f8da85323 (patch)
tree03df68f9156dc92bceca50a40afdd6854139742d /sc/qa/unit/opencl-test.cxx
parentf928820af4234725c98dd82e997ead2b1966a0dc (diff)
GPU Calc: unit test cases for BITLSHFIT
Need to turn on NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test AMLOEXT-167 BUG Change-Id: Id20ca1ee503f593460b99d9701c77c5c63d9d845 Signed-off-by: haochen <haochen@multicorewareinc.com> Signed-off-by: I-Jui (Ray) Sung <ray@multicorewareinc.com>
Diffstat (limited to 'sc/qa/unit/opencl-test.cxx')
-rw-r--r--sc/qa/unit/opencl-test.cxx25
1 files changed, 25 insertions, 0 deletions
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index 9ee6b1b5bc78..ff650658bb29 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -208,6 +208,7 @@ public:
void testStatisticalFormulaSkew();
void testMathFormulaArcTan2();
void testMathFormulaBitOr();
+ void testMathFormulaBitLshift();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -347,6 +348,7 @@ public:
CPPUNIT_TEST(testStatisticalFormulaSkew);
CPPUNIT_TEST(testMathFormulaArcTan2);
CPPUNIT_TEST(testMathFormulaBitOr);
+ CPPUNIT_TEST(testMathFormulaBitLshift);
CPPUNIT_TEST_SUITE_END();
private:
@@ -3765,6 +3767,29 @@ void ScOpenclTest::testStatisticalFormulaChiDist()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-167]
+void ScOpenclTest::testMathFormulaBitLshift()
+{
+ if (!detectOpenCLDevice())
+ return;
+ ScDocShellRef xDocSh = loadDoc("opencl/math/BitLshift.", ODS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/math/BitLshift.", ODS);
+ ScDocument* pDocRes = xDocShRes->GetDocument();
+ CPPUNIT_ASSERT(pDocRes);
+ // Verify BitLshift 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()
{