summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authoryiming ju <yiming@multicorewareinc.com>2013-11-07 14:54:11 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-11-13 17:44:14 -0600
commitb07bfeea13e32a6fbf70d5932901a95c02ebf878 (patch)
treed3b72db0ed57eb9edd59ac3c051d93c3b7eb196c /sc
parent6cd4e84d34a2644201bf6dbb7719a8d054b73ad0 (diff)
GPU Calc: unit test cases for LN
Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test AMLOEXT-154 BUG Change-Id: Icf35e717a740515e86195699b776d0910c71b1f0 Signed-off-by: haochen <haochen@multicorewareinc.com> Signed-off-by: I-Jui (Ray) Sung <ray@multicorewareinc.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/unit/data/xls/opencl/math/LN.xlsbin0 -> 6144 bytes
-rw-r--r--sc/qa/unit/opencl-test.cxx25
-rw-r--r--sc/source/core/tool/token.cxx1
3 files changed, 26 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/opencl/math/LN.xls b/sc/qa/unit/data/xls/opencl/math/LN.xls
new file mode 100644
index 000000000000..e57d809ae846
--- /dev/null
+++ b/sc/qa/unit/data/xls/opencl/math/LN.xls
Binary files differ
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index 4c27c586456b..ffd7e8c7f036 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -176,6 +176,7 @@ public:
void testStatisticalFormulaForecast();
void testStatisticalFormulaLogNormDist();
void testStatisticalFormulaGammaDist();
+ void testMathFormulaLN();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -283,6 +284,7 @@ public:
CPPUNIT_TEST(testStatisticalFormulaForecast);
CPPUNIT_TEST(testStatisticalFormulaLogNormDist);
CPPUNIT_TEST(testStatisticalFormulaGammaDist);
+ CPPUNIT_TEST(testMathFormulaLN);
CPPUNIT_TEST_SUITE_END();
private:
@@ -3046,6 +3048,29 @@ void ScOpenclTest::testMathFormulaBitAnd()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-154]
+void ScOpenclTest::testMathFormulaLN()
+{
+ if (!detectOpenCLDevice())
+ return;
+ ScDocShellRef xDocSh = loadDoc("opencl/math/LN.", XLS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/math/LN.", XLS);
+ ScDocument* pDocRes = xDocShRes->GetDocument();
+ CPPUNIT_ASSERT(pDocRes);
+ // Check the results of formula cells in the shared formula range.
+ for (SCROW i = 1; i <= 9; ++i)
+ {
+ double fLibre = pDoc->GetValue(ScAddress(1,i,0));
+ double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
+ }
+ xDocSh->DoClose();
+ xDocShRes->DoClose();
+}
//[AMLOEXT-157]
void ScOpenclTest::testStatisticalFormulaGammaDist()
{
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 1fb60b2bc465..2e4aa241f7a5 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -1410,6 +1410,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocForecast:
case ocLogNormDist:
case ocGammaDist:
+ case ocLn:
// Don't change the state.
break;
default: