diff options
-rw-r--r-- | sc/qa/unit/data/xls/opencl/financial/VDB.xls | bin | 0 -> 22016 bytes | |||
-rw-r--r-- | sc/qa/unit/opencl-test.cxx | 36 | ||||
-rw-r--r-- | sc/source/core/tool/token.cxx | 1 |
3 files changed, 37 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/opencl/financial/VDB.xls b/sc/qa/unit/data/xls/opencl/financial/VDB.xls Binary files differnew file mode 100644 index 000000000000..d0f58b510f5f --- /dev/null +++ b/sc/qa/unit/data/xls/opencl/financial/VDB.xls diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index 8d5d1d61ed0f..78bf08b35016 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -138,6 +138,7 @@ public: void testFinancialFVFormula(); void testFinancialMDurationFormula(); void testMathSumIfsFormula(); + void testFinancialVDBFormula(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -207,6 +208,7 @@ public: CPPUNIT_TEST(testFinancialFVFormula); CPPUNIT_TEST(testFinancialMDurationFormula); CPPUNIT_TEST(testMathSumIfsFormula); + CPPUNIT_TEST(testFinancialVDBFormula); CPPUNIT_TEST_SUITE_END(); private: @@ -2088,6 +2090,40 @@ void ScOpenclTest::testMathSumIfsFormula() xDocSh->DoClose(); xDocShRes->DoClose(); } + //[AMLOEXT-133] +void ScOpenclTest:: testFinancialVDBFormula() +{ + if (!detectOpenCLDevice()) + return; + ScDocShellRef xDocSh = loadDoc("opencl/financial/VDB.", XLS); + ScDocument *pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + ScDocShellRef xDocShRes = loadDoc("opencl/financial/VDB.", XLS); + ScDocument *pDocRes = xDocShRes->GetDocument(); + CPPUNIT_ASSERT(pDocRes); + for (SCROW i = 0; i <= 10; ++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)); + } + for (SCROW i = 15; i <= 26; ++i) + { + double fLibre = pDoc->GetValue(ScAddress(6, i, 0)); + double fExcel = pDocRes->GetValue(ScAddress(6, i, 0)); + CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); + } + for (SCROW i = 30; i <= 41; ++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(); +} ScOpenclTest::ScOpenclTest() : ScBootstrapFixture( "/sc/qa/unit/data" ) { diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index b738e1669e52..02dd30a68d9c 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -1379,6 +1379,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r ) case ocMedian: case ocGDA: case ocZW: + case ocVBD: // Don't change the state. break; default: |