summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormulei <mulei@multicorewareinc.com>2013-11-07 15:51:07 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-11-14 14:09:41 -0600
commitbc135e35aa0c28f2365770f6d027df73cb07f67b (patch)
tree14d44874f49195eea5e371a3b51a9a9dcfd57ddb
parent8aa6ad0ae7b55b3fb456dd7780869e76da68d31c (diff)
GPU Calc: unit test cases for NPER with formula argument
Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test AMLOEXT-146 BUG Change-Id: I0884f0c43c3a84c10abb0f1cc391b57b67006c1f 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/NPER1.xlsbin0 -> 7168 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/NPER1.xls b/sc/qa/unit/data/xls/opencl/financial/NPER1.xls
new file mode 100644
index 000000000000..6ba2c56d5441
--- /dev/null
+++ b/sc/qa/unit/data/xls/opencl/financial/NPER1.xls
Binary files differ
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index 7e98c6f2ef38..56b48460a0bb 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -180,6 +180,7 @@ public:
void testMathFormulaRound();
void testMathFormulaCot();
void testMathFormulaCoth();
+ void testFinacialNPER1Formula();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -291,6 +292,7 @@ public:
CPPUNIT_TEST(testMathFormulaRound);
CPPUNIT_TEST(testMathFormulaCot);
CPPUNIT_TEST(testMathFormulaCoth);
+ CPPUNIT_TEST(testFinacialNPER1Formula);
CPPUNIT_TEST_SUITE_END();
private:
@@ -3075,6 +3077,28 @@ void ScOpenclTest::testMathFormulaArcTanHyp()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-146]
+void ScOpenclTest:: testFinacialNPER1Formula()
+{
+ if (!detectOpenCLDevice())
+ return;
+ ScDocShellRef xDocSh = loadDoc("opencl/financial/NPER1.", XLS);
+ ScDocument *pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/financial/NPER1.", XLS);
+ ScDocument *pDocRes = xDocShRes->GetDocument();
+ CPPUNIT_ASSERT(pDocRes);
+ for (SCROW i = 0; i <= 6; ++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-149]
void ScOpenclTest::testMathFormulaBitAnd()
{