summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/qa/unit/data/ods/opencl/financial/XIRR.odsbin0 -> 59488 bytes
-rw-r--r--sc/qa/unit/data/xls/opencl/financial/XIRR.xlsbin7680 -> 0 bytes
-rw-r--r--sc/qa/unit/opencl-test.cxx27
3 files changed, 13 insertions, 14 deletions
diff --git a/sc/qa/unit/data/ods/opencl/financial/XIRR.ods b/sc/qa/unit/data/ods/opencl/financial/XIRR.ods
new file mode 100644
index 000000000000..a9d2476d1066
--- /dev/null
+++ b/sc/qa/unit/data/ods/opencl/financial/XIRR.ods
Binary files differ
diff --git a/sc/qa/unit/data/xls/opencl/financial/XIRR.xls b/sc/qa/unit/data/xls/opencl/financial/XIRR.xls
deleted file mode 100644
index b9a87ef8b58c..000000000000
--- a/sc/qa/unit/data/xls/opencl/financial/XIRR.xls
+++ /dev/null
Binary files differ
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index 843c9a90b2b1..9def7e8bb24a 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -3405,28 +3405,27 @@ void ScOpenclTest:: testFinancialXirrFormula()
{
if (!detectOpenCLDevice())
return;
- ScDocShellRef xDocSh = loadDoc("opencl/financial/XIRR.", XLS);
+
+ ScDocShellRef xDocSh = loadDoc("opencl/financial/XIRR.", ODS);
+ CPPUNIT_ASSERT(xDocSh.Is());
ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
enableOpenCL();
pDoc->CalcAll();
- ScDocShellRef xDocShRes = loadDoc("opencl/financial/XIRR.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
- for (SCROW i = 0; i <= 9; ++i)
+
+ for (SCROW i = 1; i <= 10; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(2, i, 0));
- CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
+ double fFormula = pDoc->GetValue(ScAddress(2, i, 0));
+ double fExpected = pDoc->GetValue(ScAddress(3, i, 0));
+ CPPUNIT_ASSERT(rtl::math::approxEqual(fExpected, fFormula));
}
- for (SCROW i = 18; i <= 26; ++i)
+ for (SCROW i = 18; i <= 27; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(2, i, 0));
- CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
+ double fFormula = pDoc->GetValue(ScAddress(2, i, 0));
+ double fExpected = pDoc->GetValue(ScAddress(3, i, 0));
+ CPPUNIT_ASSERT(rtl::math::approxEqual(fExpected, fFormula));
}
+
xDocSh->DoClose();
- xDocShRes->DoClose();
}
//[AMLOEXT-139]
void ScOpenclTest::testStatisticalFormulaChiSqDist()