diff options
Diffstat (limited to 'sc/qa/unit/opencl-test.cxx')
-rw-r--r-- | sc/qa/unit/opencl-test.cxx | 24 |
1 files changed, 24 insertions, 0 deletions
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() { |