summaryrefslogtreecommitdiff
path: root/sc/qa/unit/opencl-test.cxx
diff options
context:
space:
mode:
authoryangzhang <yangzhang@multicorewareinc.com>2013-11-12 09:06:42 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-11-15 11:54:25 -0600
commit2a18dc332689f5d02e6d178493cb0c07a8bb7861 (patch)
tree84e5002c415f7ed33f1fa3ec7a49fd9e577bd480 /sc/qa/unit/opencl-test.cxx
parent61c3a61baa2054f2962b922614f0098a203c33a3 (diff)
GPU Calc: unit test cases for CEIL
Need to turn on NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test AMLOEXT-181 BUG Change-Id: I5ace7bedd8b99705b30b23aedc8a8e2075fc51c6 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.cxx27
1 files changed, 27 insertions, 0 deletions
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index d64f1f53d09f..d8393a63025c 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -218,6 +218,7 @@ public:
void testMathFormulaSqrtPi();
void testStatisticalFormulaBinomDist();
void testStatisticalFormulaVarP();
+ void testMathFormulaCeil();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -367,6 +368,7 @@ public:
CPPUNIT_TEST(testMathFormulaSqrtPi);
CPPUNIT_TEST(testStatisticalFormulaBinomDist);
CPPUNIT_TEST(testStatisticalFormulaVarP);
+ CPPUNIT_TEST(testMathFormulaCeil);
CPPUNIT_TEST_SUITE_END();
private:
@@ -4083,6 +4085,31 @@ void ScOpenclTest::testMathFormulaCombina()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-181]
+void ScOpenclTest::testMathFormulaCeil()
+{
+ if (!detectOpenCLDevice())
+ return;
+ ScDocShellRef xDocSh =
+ loadDoc("opencl/math/Ceil.", ODS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes =
+ loadDoc("opencl/math/Ceil.", ODS);
+ ScDocument* pDocRes = xDocShRes->GetDocument();
+ CPPUNIT_ASSERT(pDocRes);
+ // Verify Ceiling 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-182]
void ScOpenclTest::testMathFormulaSqrtPi()
{