diff options
author | minwang <min@multicorewareinc.com> | 2013-11-06 14:18:10 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-11-13 14:39:23 -0600 |
commit | 246e0148aacfbdf6f5c294464ae0a4e063443bb8 (patch) | |
tree | f2d62ab6bfeac3b85cabd54e086d82af767562dc /sc | |
parent | 570aa2e905ea421d6be6232ae6ba89a8d0127bbf (diff) |
GPU Calc: unit test cases for DB
Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test
AMLOEXT-132 BUG
Change-Id: I89dca4895fd8952ec085a30d42d75e05e0ed96d1
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/financial/db.xls | bin | 0 -> 19968 bytes | |||
-rw-r--r-- | sc/qa/unit/opencl-test.cxx | 24 | ||||
-rw-r--r-- | sc/source/core/tool/token.cxx | 1 |
3 files changed, 25 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/opencl/financial/db.xls b/sc/qa/unit/data/xls/opencl/financial/db.xls Binary files differnew file mode 100644 index 000000000000..81cd024a51f9 --- /dev/null +++ b/sc/qa/unit/data/xls/opencl/financial/db.xls diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index f32f585be477..908532022a88 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -159,6 +159,7 @@ public: void testFinacialODDLPRICEFormula(); void testFinacialOddlyieldFormula(); void testFinacialPriceDiscFormula(); + void testFinancialDBFormula(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -249,6 +250,7 @@ public: CPPUNIT_TEST(testFinacialODDLPRICEFormula); CPPUNIT_TEST(testFinacialOddlyieldFormula); CPPUNIT_TEST(testFinacialPriceDiscFormula); + CPPUNIT_TEST(testFinancialDBFormula); CPPUNIT_TEST_SUITE_END(); private: @@ -2479,6 +2481,28 @@ void ScOpenclTest:: testFinancialFVFormula() xDocSh->DoClose(); xDocShRes->DoClose(); } +//[AMLOEXT-132] +void ScOpenclTest::testFinancialDBFormula() +{ + if (!detectOpenCLDevice()) + return; + ScDocShellRef xDocSh = loadDoc("opencl/financial/db.", XLS); + ScDocument* pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + ScDocShellRef xDocShRes = loadDoc("opencl/financial/db.", 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(); +} //[AMLOEXT-128] void ScOpenclTest::testMathSumIfsFormula() { diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index 2a71c96d47ca..48d15780431c 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -1396,6 +1396,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r ) case ocZinsZ: case ocConfidence: case ocIntercept: + case ocGDA2: // Don't change the state. break; default: |