summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorminwang <min@multicorewareinc.com>2013-11-06 15:15:15 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-11-13 17:44:07 -0600
commitc0e2c19f629403f66e0290ece29c895629287593 (patch)
tree8bc5e1cb716ebc0d561e2e67ca43a7378b1195dc
parent541b0791549097b379a57270f55d09603417a4e8 (diff)
GPU Calc: unit test cases for ACCRINT
Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test AMLOEXT-138 BUG Change-Id: If1e82dda864f06b0deea448e3bfbaf116b2c6ee4 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/Accrint.xlsbin0 -> 6656 bytes
-rw-r--r--sc/qa/unit/opencl-test.cxx24
2 files changed, 24 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/opencl/financial/Accrint.xls b/sc/qa/unit/data/xls/opencl/financial/Accrint.xls
new file mode 100644
index 000000000000..4c792e50fb81
--- /dev/null
+++ b/sc/qa/unit/data/xls/opencl/financial/Accrint.xls
Binary files differ
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index 5aed6a1afcba..b306c2d26218 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -80,6 +80,7 @@ public:
void testFinacialMIRRFormula();
void testFinacialRateFormula();
void testFinancialAccrintmFormula();
+ void testFinancialAccrintFormula();
void testCompilerNested();
void testFinacialSLNFormula();
void testStatisticalFormulaGammaLn();
@@ -255,6 +256,7 @@ public:
CPPUNIT_TEST(testFinancialDBFormula);
CPPUNIT_TEST(testFinancialCouppcdFormula);
CPPUNIT_TEST(testFinancialCoupncdFormula);
+ CPPUNIT_TEST(testFinancialAccrintFormula);
CPPUNIT_TEST_SUITE_END();
private:
@@ -2700,6 +2702,28 @@ void ScOpenclTest::testFinancialCoupncdFormula()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-138]
+void ScOpenclTest::testFinancialAccrintFormula()
+{
+ if (!detectOpenCLDevice())
+ return;
+ ScDocShellRef xDocSh = loadDoc("opencl/financial/Accrint.", XLS);
+ ScDocument *pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/financial/Accrint.", XLS);
+ ScDocument *pDocRes = xDocShRes->GetDocument();
+ CPPUNIT_ASSERT(pDocRes);
+ for (SCROW i = 0; i <= 9; ++i)
+ {
+ double fLibre = pDoc->GetValue(ScAddress(7, i, 0));
+ double fExcel = pDocRes->GetValue(ScAddress(7, i, 0));
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
+ }
+ xDocSh->DoClose();
+ xDocShRes->DoClose();
+}
ScOpenclTest::ScOpenclTest()
: ScBootstrapFixture( "/sc/qa/unit/data" )
{