summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormulei <mulei@multicorewareinc.com>2013-11-06 13:39:17 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-11-13 14:39:22 -0600
commite43592d38eb85f93692d33322eec7302775423ea (patch)
tree592ad4fa3939fcda3b68352d823217b5d66de358
parentd6c0c2151053601bc9430e9e17b5e6b284ba5f65 (diff)
GPU Calc: unit test cases for ODDLYIELD
Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test AMLOEXT-68 BUG Change-Id: I432fdb4fbab18e5689c2a657b679a57424261c43 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/Oddlyield.xlsbin0 -> 7680 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/Oddlyield.xls b/sc/qa/unit/data/xls/opencl/financial/Oddlyield.xls
new file mode 100644
index 000000000000..daaa0d275cc0
--- /dev/null
+++ b/sc/qa/unit/data/xls/opencl/financial/Oddlyield.xls
Binary files differ
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index e5c3abcd104a..92a343d0e8b0 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -157,6 +157,7 @@ public:
void testStatisticalFormulaConfidence();
void testStatisticalFormulaIntercept();
void testFinacialODDLPRICEFormula();
+ void testFinacialOddlyieldFormula();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -245,6 +246,7 @@ public:
CPPUNIT_TEST(testStatisticalFormulaConfidence);
CPPUNIT_TEST(testStatisticalFormulaIntercept);
CPPUNIT_TEST(testFinacialODDLPRICEFormula);
+ CPPUNIT_TEST(testFinacialOddlyieldFormula);
CPPUNIT_TEST_SUITE_END();
private:
@@ -1393,6 +1395,28 @@ void ScOpenclTest::testFinacialODDLPRICEFormula()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-68]
+void ScOpenclTest:: testFinacialOddlyieldFormula()
+{
+ if (!detectOpenCLDevice())
+ return;
+ ScDocShellRef xDocSh = loadDoc("opencl/financial/Oddlyield.", XLS);
+ ScDocument *pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/financial/Oddlyield.", XLS);
+ ScDocument *pDocRes = xDocShRes->GetDocument();
+ CPPUNIT_ASSERT(pDocRes);
+ for (SCROW i = 0; i <= 6; ++i)
+ {
+ double fLibre = pDoc->GetValue(ScAddress(8, i, 0));
+ double fExcel = pDocRes->GetValue(ScAddress(8, i, 0));
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
+ }
+ xDocSh->DoClose();
+ xDocShRes->DoClose();
+}
//[AMLOEXT-71]
void ScOpenclTest::testFinacialDISCFormula()
{