summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorminwang <min@multicorewareinc.com>2013-11-05 10:42:57 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-11-12 22:38:26 -0600
commitb723d47dee7cd1e31364a74daa10764aa531f04f (patch)
tree9fab33d8db7b726f76ffa08529c03002d38319ba
parent48caa626012312e2ec13df5008c041b29acab44c (diff)
GPU Calc: unit test cases for DDB
Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test AMLOEXT-124 BUG Change-Id: Idfe027b7d5d61b093af60536ac4f482d5b6bda2d 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/financial/ddb.xlsbin0 -> 6656 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/financial/ddb.xls b/sc/qa/unit/data/xls/opencl/financial/ddb.xls
new file mode 100644
index 000000000000..e98ae085a08a
--- /dev/null
+++ b/sc/qa/unit/data/xls/opencl/financial/ddb.xls
Binary files differ
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index bc261134d1b0..0dd15c4ff8ed 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -134,6 +134,7 @@ public:
void testFinancialDuration_ADDFormula();
void testFinancialAmordegrcFormula();
void testFinancialAmorlincFormula();
+ void testFinancialDDBFormula();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -199,6 +200,7 @@ public:
CPPUNIT_TEST(testFinancialDuration_ADDFormula);
CPPUNIT_TEST(testFinancialAmordegrcFormula);
CPPUNIT_TEST(testFinancialAmorlincFormula);
+ CPPUNIT_TEST(testFinancialDDBFormula);
CPPUNIT_TEST_SUITE_END();
private:
@@ -1607,6 +1609,28 @@ void ScOpenclTest::testFinancialAmorlincFormula()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-124]
+void ScOpenclTest::testFinancialDDBFormula()
+{
+ if (!detectOpenCLDevice())
+ return;
+ ScDocShellRef xDocSh = loadDoc("opencl/financial/ddb.", XLS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/financial/ddb.", XLS);
+ ScDocument* pDocRes = xDocShRes->GetDocument();
+ CPPUNIT_ASSERT(pDocRes);
+ for (SCROW i = 0; i <= 9; ++i)
+ {
+ double fLibre = pDoc->GetValue(ScAddress(5, i, 0));
+ double fExcel = pDocRes->GetValue(ScAddress(5, i, 0));
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
+ }
+ xDocSh->DoClose();
+ xDocShRes->DoClose();
+}
void ScOpenclTest::testFinacialPriceMatFormula()
{
if (!detectOpenCLDevice())
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 1bcf7262a1b7..a3d2ebb7a385 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -1377,6 +1377,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocStandard:
case ocWeibull:
case ocMedian:
+ case ocGDA:
// Don't change the state.
break;
default: