summaryrefslogtreecommitdiff
path: root/sc/qa/unit/opencl-test.cxx
diff options
context:
space:
mode:
authorzhenyu yuan <zhenyuyuan@multicorewareinc.com>2013-11-09 19:31:28 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-11-14 20:30:37 -0600
commit34385d523cf36a1580d479b25734e9e48731d0d7 (patch)
treea19193e8db1c5bfc126643541ed02d179188e79a /sc/qa/unit/opencl-test.cxx
parent15cf2c5147d8810b8ed9e84b1ce764096566d837 (diff)
GPU Calc: unit test cases for LOG
Need to turn on NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test AMLOEXT-170 BUG Change-Id: I79b48e41f594d80239964353ff988211e9d0f28b 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.cxx26
1 files changed, 26 insertions, 0 deletions
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index 657da6a893be..73e9de6f4395 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -202,6 +202,7 @@ public:
void testMathCountIfsFormula();
void testMathFormulaCombina();
void testMathFormulaEven();
+ void testMathFormulaLog();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -335,6 +336,7 @@ public:
CPPUNIT_TEST(testMathCountIfsFormula);
CPPUNIT_TEST(testMathFormulaCombina);
CPPUNIT_TEST(testMathFormulaEven);
+ CPPUNIT_TEST(testMathFormulaLog);
CPPUNIT_TEST_SUITE_END();
private:
@@ -3652,6 +3654,30 @@ void ScOpenclTest::testMathFormulaFloor()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-170]
+void ScOpenclTest::testMathFormulaLog()
+{
+ if (!detectOpenCLDevice())
+ return;
+
+ ScDocShellRef xDocSh = loadDoc("opencl/math/log.", XLS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/math/log.", XLS);
+ ScDocument* pDocRes = xDocShRes->GetDocument();
+ CPPUNIT_ASSERT(pDocRes);
+ for (SCROW i = 0; i <= 47; ++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-176 ]
void ScOpenclTest::testMathCountIfsFormula()
{