summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordechuang <dechuang@multicorewareinc.com>2013-11-08 09:23:32 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-11-14 14:09:44 -0600
commitc7252be5c2fd0ef58167ea0c0e9f4f281cd9eacc (patch)
treeb51c2ab0eb1a4c68d7ecd0296ac94ddbdce65d71
parent27097337431ee4db3cf88f80c94817c91bb76dee (diff)
GPU Calc: unit test cases for ODD
Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test AMLOEXT-153 BUG Change-Id: Ia112c99128b21c02e1fafabeeedbf065c8a6e92f Signed-off-by: haochen <haochen@multicorewareinc.com> Signed-off-by: I-Jui (Ray) Sung <ray@multicorewareinc.com>
-rw-r--r--sc/qa/unit/data/xls/opencl/math/odd.xlsbin0 -> 19968 bytes
-rw-r--r--sc/qa/unit/opencl-test.cxx24
-rw-r--r--sc/source/core/tool/token.cxx1
3 files changed, 25 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/opencl/math/odd.xls b/sc/qa/unit/data/xls/opencl/math/odd.xls
new file mode 100644
index 000000000000..95adbcf0939d
--- /dev/null
+++ b/sc/qa/unit/data/xls/opencl/math/odd.xls
Binary files differ
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index b5427bb78bbc..7ebbb27db569 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -185,6 +185,7 @@ public:
void testStatisticalFormulaVar();
void testStatisticalFormulaChiDist();
void testMathFormulaPower();
+ void testMathFormulaOdd();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -301,6 +302,7 @@ public:
CPPUNIT_TEST(testStatisticalFormulaVar);
CPPUNIT_TEST(testStatisticalFormulaChiDist);
CPPUNIT_TEST(testMathFormulaPower);
+ CPPUNIT_TEST(testMathFormulaOdd);
CPPUNIT_TEST_SUITE_END();
private:
@@ -3202,6 +3204,28 @@ void ScOpenclTest::testMathFormulaBitAnd()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-153]
+void ScOpenclTest::testMathFormulaOdd()
+{
+ if (!detectOpenCLDevice())
+ return;
+ ScDocShellRef xDocSh = loadDoc("opencl/math/odd.", XLS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/math/odd.", XLS);
+ ScDocument* pDocRes = xDocShRes->GetDocument();
+ CPPUNIT_ASSERT(pDocRes);
+ for (SCROW i = 0; i <= 15; ++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-154]
void ScOpenclTest::testMathFormulaLN()
{
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 5c656520bcc5..3a099e1e28a1 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -1418,6 +1418,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocVar:
case ocChiDist:
case ocPower:
+ case ocOdd:
// Don't change the state.
break;
default: