sc/CppunitTest_sc_opencl-1.mk | 24 sc/CppunitTest_sc_opencl-2.mk | 80 + sc/Module_sc.mk | 3 sc/qa/unit/opencl-test-1.cxx | 2317 ++-------------------------------------- sc/qa/unit/opencl-test-2.cxx | 2153 +++++++++++++++++++++++++++++++++++++ solenv/clang-format/excludelist | 3 6 files changed, 2384 insertions(+), 2196 deletions(-)
New commits: commit 98f9b51d5878e7a426c1244177d16f49ce639ae4 Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Fri Jan 27 13:19:25 2023 +0100 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Fri Jan 27 14:28:34 2023 +0000 Split long-running CppunitTest_sc_opencl_test in two At least the unrelated <https://ci.libreoffice.org/job/gerrit_linux_clang_dbgutil/132372/> was killed after 20 minutes of no stdout/-err activity, with CppunitTest_sc_opencl_test still running. From its captured state, it looks like it was indeed still making progress rather than being stuck: During ScOpenCLTest::testLogicalFormulaXor, the main thread was waiting at ScFormulaCell::InterpretFormulaGroupThreading -> comphelper::ThreadPool::waitUntilDone, while four comphelper::ThreadPool::ThreadWorker threads were each at > #4 0x00007f70652f9234 in __gnu_debug::_Safe_iterator_base::_M_detach() () at /lib64/libstdc++.so.6 > #5 0x00007f7048d3e8e5 in __gnu_debug::_Safe_iterator_base::~_Safe_iterator_base() (this=0x7f703daa9f20) at /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/debug/safe_base.h:100 > #6 0x00007f7048d5d709 in __gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<mdds::mtv::base_element_block* const*, std::__cxx1998::vector<mdds::mtv::base_element_block*, std::allocator<mdds::mtv::base_element_block*> > >, std::__debug::vector<mdds::mtv::base_element_block*, std::allocator<mdds::mtv::base_element_block*> > >::~_Safe_iterator() (this=0x7f703daa9f18) at /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/debug/safe_iterator.h:86 > #7 0x00007f7048d5d6cd in mdds::mtv::soa::detail::iterator_updater<mdds::mtv::soa::multi_type_vector<sc::CellStoreTraits>::const_iterator_trait>::grouped_iterator_type::~grouped_iterator_type() (this=0x7f703daa9ec8) at workdir/UnpackedTarball/mdds/include/mdds/multi_type_vector/soa/./iterator.hpp:74 > #8 0x00007f7048d5d69d in mdds::mtv::soa::detail::iterator_updater<mdds::mtv::soa::multi_type_vector<sc::CellStoreTraits>::const_iterator_trait>::~iterator_updater() (this=0x7f703daa9e98) at workdir/UnpackedTarball/mdds/include/mdds/multi_type_vector/soa/./iterator.hpp:55 > #9 0x00007f7048d5d665 in mdds::mtv::soa::detail::const_iterator_base<mdds::mtv::soa::multi_type_vector<sc::CellStoreTraits>::const_iterator_trait, mdds::mtv::soa::detail::iterator_base<mdds::mtv::soa::multi_type_vector<sc::CellStoreTraits>::iterator_trait> >::~const_iterator_base() (this=0x7f703daa9e98) at workdir/UnpackedTarball/mdds/include/mdds/multi_type_vector/soa/./iterator.hpp:309 > #10 0x00007f704900b9bd in ScValueIterator::GetThis(double&, FormulaError&) (this=0x7f703daaa078, rValue=@0x7f703daaa1f8: -18.819375178914722, rErr=@0x7f703daaa1f6: NONE) at sc/source/core/data/dociter.cxx:141 > #11 0x00007f704900c652 in ScValueIterator::GetNext(double&, FormulaError&) (this=0x7f703daaa078, rValue=@0x7f703daaa1f8: -18.819375178914722, rErr=@0x7f703daaa1f6: NONE) at sc/source/core/data/dociter.cxx:297 > #12 0x00007f70496c3619 in ScInterpreter::ScXor() (this=0x48b93a0) at sc/source/core/tool/interpr1.cxx:1525 with three of them apparently waiting in pthread_mutex_lock but one in pthread_mutex_unlock (and thus presumably making progress). It looks like with a debug-mode libstdc++ these worker threads can easily compete for these listdc++-internal debug-mode mutices. And execution of --enable-dbgutil CppunitTest_sc_opencl_test on my Linux laptop under load easily took 35 minutes, so it looks plausible that that unit test was just too big. While splitting it in two (arbitrarily taking the first and second half of the CPPUNIT_TEST list), use the opportunity to drop the redundant "_test" from the two new target names CppunitTest_sc_opencl-1 and CppunitTest_sc_opencl-2. Change-Id: I9b8f148db667ff9bbf1aacdcaf150e5cb9b8ae87 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146252 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/sc/CppunitTest_sc_opencl_test.mk b/sc/CppunitTest_sc_opencl-1.mk similarity index 62% rename from sc/CppunitTest_sc_opencl_test.mk rename to sc/CppunitTest_sc_opencl-1.mk index f55b8ef5ce64..ac8ac86d63fd 100644 --- a/sc/CppunitTest_sc_opencl_test.mk +++ b/sc/CppunitTest_sc_opencl-1.mk @@ -7,22 +7,22 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # -$(eval $(call gb_CppunitTest_CppunitTest,sc_opencl_test)) +$(eval $(call gb_CppunitTest_CppunitTest,sc_opencl-1)) -$(eval $(call gb_CppunitTest_use_common_precompiled_header,sc_opencl_test)) +$(eval $(call gb_CppunitTest_use_common_precompiled_header,sc_opencl-1)) -$(eval $(call gb_CppunitTest_add_exception_objects,sc_opencl_test, \ - sc/qa/unit/opencl-test \ +$(eval $(call gb_CppunitTest_add_exception_objects,sc_opencl-1, \ + sc/qa/unit/opencl-test-1 \ )) -$(eval $(call gb_CppunitTest_use_externals,sc_opencl_test, \ +$(eval $(call gb_CppunitTest_use_externals,sc_opencl-1, \ boost_headers \ $(call gb_Helper_optional,OPENCL,clew) \ mdds_headers \ libxml2 \ )) -$(eval $(call gb_CppunitTest_use_libraries,sc_opencl_test, \ +$(eval $(call gb_CppunitTest_use_libraries,sc_opencl-1, \ basegfx \ comphelper \ cppu \ @@ -57,24 +57,24 @@ $(eval $(call gb_CppunitTest_use_libraries,sc_opencl_test, \ xo \ )) -$(eval $(call gb_CppunitTest_set_include,sc_opencl_test,\ +$(eval $(call gb_CppunitTest_set_include,sc_opencl-1,\ -I$(SRCDIR)/sc/source/ui/inc \ -I$(SRCDIR)/sc/source/core/inc \ -I$(SRCDIR)/sc/inc \ $$(INCLUDE) \ )) -$(eval $(call gb_CppunitTest_use_api,sc_opencl_test,\ +$(eval $(call gb_CppunitTest_use_api,sc_opencl-1,\ udkapi \ offapi \ oovbaapi \ )) -$(eval $(call gb_CppunitTest_use_ure,sc_opencl_test)) -$(eval $(call gb_CppunitTest_use_vcl,sc_opencl_test)) +$(eval $(call gb_CppunitTest_use_ure,sc_opencl-1)) +$(eval $(call gb_CppunitTest_use_vcl,sc_opencl-1)) -$(eval $(call gb_CppunitTest_use_rdb,sc_opencl_test,services)) +$(eval $(call gb_CppunitTest_use_rdb,sc_opencl-1,services)) -$(eval $(call gb_CppunitTest_use_configuration,sc_opencl_test)) +$(eval $(call gb_CppunitTest_use_configuration,sc_opencl-1)) # vim: set noet sw=4 ts=4: diff --git a/sc/CppunitTest_sc_opencl-2.mk b/sc/CppunitTest_sc_opencl-2.mk new file mode 100644 index 000000000000..c130d44605d5 --- /dev/null +++ b/sc/CppunitTest_sc_opencl-2.mk @@ -0,0 +1,80 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_CppunitTest_CppunitTest,sc_opencl-2)) + +$(eval $(call gb_CppunitTest_use_common_precompiled_header,sc_opencl-2)) + +$(eval $(call gb_CppunitTest_add_exception_objects,sc_opencl-2, \ + sc/qa/unit/opencl-test-2 \ +)) + +$(eval $(call gb_CppunitTest_use_externals,sc_opencl-2, \ + boost_headers \ + $(call gb_Helper_optional,OPENCL,clew) \ + mdds_headers \ + libxml2 \ +)) + +$(eval $(call gb_CppunitTest_use_libraries,sc_opencl-2, \ + basegfx \ + comphelper \ + cppu \ + cppuhelper \ + drawinglayer \ + drawinglayercore \ + editeng \ + for \ + forui \ + i18nlangtag \ + msfilter \ + oox \ + sal \ + salhelper \ + sax \ + sc \ + scqahelper \ + sfx \ + sot \ + subsequenttest \ + svl \ + svt \ + svx \ + svxcore \ + test \ + tk \ + tl \ + ucbhelper \ + unotest \ + utl \ + vcl \ + xo \ +)) + +$(eval $(call gb_CppunitTest_set_include,sc_opencl-2,\ + -I$(SRCDIR)/sc/source/ui/inc \ + -I$(SRCDIR)/sc/source/core/inc \ + -I$(SRCDIR)/sc/inc \ + $$(INCLUDE) \ +)) + +$(eval $(call gb_CppunitTest_use_api,sc_opencl-2,\ + udkapi \ + offapi \ + oovbaapi \ +)) + +$(eval $(call gb_CppunitTest_use_ure,sc_opencl-2)) +$(eval $(call gb_CppunitTest_use_vcl,sc_opencl-2)) + +$(eval $(call gb_CppunitTest_use_rdb,sc_opencl-2,services)) + +$(eval $(call gb_CppunitTest_use_configuration,sc_opencl-2)) + +# vim: set noet sw=4 ts=4: diff --git a/sc/Module_sc.mk b/sc/Module_sc.mk index 98d555316f9c..8e0644f73940 100644 --- a/sc/Module_sc.mk +++ b/sc/Module_sc.mk @@ -202,7 +202,8 @@ $(eval $(call gb_Module_add_subsequentcheck_targets,sc,\ CppunitTest_sc_modelobj \ CppunitTest_sc_namedrangeobj \ CppunitTest_sc_namedrangesobj \ - CppunitTest_sc_opencl_test \ + CppunitTest_sc_opencl-1 \ + CppunitTest_sc_opencl-2 \ CppunitTest_sc_outlineobj \ CppunitTest_sc_recentfunctionsobj \ CppunitTest_sc_recordchanges \ diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test-1.cxx similarity index 50% rename from sc/qa/unit/opencl-test.cxx rename to sc/qa/unit/opencl-test-1.cxx index a3a278ae3a89..773c576b40db 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test-1.cxx @@ -17,11 +17,11 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::uno; -class ScOpenCLTest +class ScOpenCLTest1 : public ScModelTestBase { public: - ScOpenCLTest(); + ScOpenCLTest1(); /** * Turn on OpenCL group interpreter. Call this after the document is @@ -150,120 +150,8 @@ public: void testMathFormulaCot(); void testMathFormulaCoth(); void testFinacialNPER1Formula(); - void testStatisticalFormulaFDist(); - void testStatisticalFormulaVar(); - void testStatisticalFormulaChiDist(); - void testMathFormulaPower(); - void testMathFormulaOdd(); - void testStatisticalFormulaChiSqDist(); - void testStatisticalFormulaChiSqInv(); - void testStatisticalFormulaGammaInv(); - void testMathFormulaFloor(); - void testStatisticalFormulaFInv(); - void testStatisticalFormulaFTest(); - void testStatisticalFormulaB(); - void testStatisticalFormulaBetaDist(); - void testMathFormulaCscH(); - void testMathFormulaExp(); - void testMathFormulaLog10(); - void testStatisticalFormulaExpondist(); - void testMathAverageIfsFormula(); - void testMathCountIfsFormula(); - void testMathFormulaCombina(); - void testMathFormulaEven(); - void testMathFormulaLog(); - void testMathFormulaMod(); - void testMathFormulaTrunc(); - void testStatisticalFormulaSkew(); - void testMathFormulaArcTan2(); - void testMathFormulaBitOr(); - void testMathFormulaBitLshift(); - void testMathFormulaBitRshift(); - void testMathFormulaBitXor(); - void testStatisticalFormulaChiInv(); - void testStatisticalFormulaPoisson(); - void testMathFormulaSumSQ(); - void testStatisticalFormulaSkewp(); - void testMathFormulaSqrtPi(); - void testStatisticalFormulaBinomDist(); - void testStatisticalFormulaVarP(); - void testMathFormulaCeil(); - // void testMathFormulaKombin(); - void testStatisticalFormulaDevSq(); - void testStatisticalFormulaStDev(); - void testStatisticalFormulaSlope(); - void testStatisticalFormulaSTEYX(); - void testStatisticalFormulaZTest(); - void testMathFormulaPi(); - void testMathFormulaRandom(); - void testMathFormulaConvert(); - void testMathFormulaProduct(); - void testStatisticalFormulaHypGeomDist(); - void testArrayFormulaSumX2MY2(); - void testArrayFormulaSumX2PY2(); - void testStatisticalFormulaBetainv(); - void testStatisticalFormulaTTest(); - void testStatisticalFormulaTDist(); - void testStatisticalFormulaTInv(); - void testArrayFormulaSumXMY2(); - void testStatisticalFormulaStDevP(); - void testStatisticalFormulaCovar(); - void testLogicalFormulaAnd(); - void testLogicalFormulaOr(); - void testMathFormulaSumProduct(); - void testMathFormulaSumProduct2(); - void testStatisticalParallelCountBug(); - void testSpreadSheetFormulaVLookup(); - void testLogicalFormulaNot(); - void testLogicalFormulaXor(); - void testDatabaseFormulaDmax(); - void testDatabaseFormulaDmin(); - void testDatabaseFormulaDproduct(); - void testDatabaseFormulaDaverage(); - void testDatabaseFormulaDstdev(); - void testDatabaseFormulaDstdevp(); - void testDatabaseFormulaDsum(); - void testDatabaseFormulaDvar(); - void testDatabaseFormulaDvarp(); - void testMathFormulaAverageIf(); - void testDatabaseFormulaDcount(); - void testDatabaseFormulaDcountA(); - void testMathFormulaDegrees(); - void testMathFormulaRoundUp(); - void testMathFormulaRoundDown(); - void testMathFormulaInt(); - void testMathFormulaRadians(); - void testMathFormulaCountIf(); - void testMathFormulaIsEven(); - void testMathFormulaIsOdd(); - void testMathFormulaFact(); - void testStatisticalFormulaMina(); - void testStatisticalFormulaCountA(); - void testStatisticalFormulaMaxa(); - void testStatisticalFormulaAverageA(); - void testStatisticalFormulaVarA(); - void testStatisticalFormulaVarPA(); - void testStatisticalFormulaStDevA(); - void testStatisticalFormulaStDevPA(); - void testMathFormulaSEC(); - void testMathFormulaSECH(); - void testMathFormulaMROUND(); - void testMathFormulaSeriesSum(); - void testMathFormulaQuotient(); - void testMathFormulaSumIf(); - void testAddInFormulaBesseLJ(); - void testNegSub(); - void testStatisticalFormulaAvedev(); - void testMathFormulaAverageIf_Mix(); - void testStatisticalFormulaKurt1(); - void testStatisticalFormulaHarMean1(); - void testStatisticalFormulaVarA1(); - void testStatisticalFormulaVarPA1(); - void testStatisticalFormulaStDevA1(); - void testStatisticalFormulaStDevPA1(); - void testFinancialMDurationFormula1(); - - CPPUNIT_TEST_SUITE(ScOpenCLTest); + + CPPUNIT_TEST_SUITE(ScOpenCLTest1); CPPUNIT_TEST(testSystematic); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -380,119 +268,6 @@ public: CPPUNIT_TEST(testMathFormulaCot); CPPUNIT_TEST(testMathFormulaCoth); CPPUNIT_TEST(testFinacialNPER1Formula); - CPPUNIT_TEST(testStatisticalFormulaFDist); - CPPUNIT_TEST(testStatisticalFormulaVar); - CPPUNIT_TEST(testStatisticalFormulaChiDist); - CPPUNIT_TEST(testMathFormulaPower); - CPPUNIT_TEST(testMathFormulaOdd); - CPPUNIT_TEST(testStatisticalFormulaChiSqDist); - CPPUNIT_TEST(testStatisticalFormulaChiSqInv); - CPPUNIT_TEST(testStatisticalFormulaGammaInv); - CPPUNIT_TEST(testMathFormulaFloor); - CPPUNIT_TEST(testStatisticalFormulaFInv); - CPPUNIT_TEST(testStatisticalFormulaFTest); - CPPUNIT_TEST(testStatisticalFormulaB); - CPPUNIT_TEST(testStatisticalFormulaBetaDist); - CPPUNIT_TEST(testMathFormulaCscH); - CPPUNIT_TEST(testMathFormulaExp); - CPPUNIT_TEST(testMathFormulaLog10); - CPPUNIT_TEST(testStatisticalFormulaExpondist); - CPPUNIT_TEST(testMathAverageIfsFormula); - CPPUNIT_TEST(testMathCountIfsFormula); - CPPUNIT_TEST(testMathFormulaCombina); - CPPUNIT_TEST(testMathFormulaEven); - CPPUNIT_TEST(testMathFormulaLog); - CPPUNIT_TEST(testMathFormulaMod); - CPPUNIT_TEST(testMathFormulaTrunc); - CPPUNIT_TEST(testStatisticalFormulaSkew); - CPPUNIT_TEST(testMathFormulaArcTan2); - CPPUNIT_TEST(testMathFormulaBitOr); - CPPUNIT_TEST(testMathFormulaBitLshift); - CPPUNIT_TEST(testMathFormulaBitRshift); - CPPUNIT_TEST(testMathFormulaBitXor); - CPPUNIT_TEST(testStatisticalFormulaChiInv); - CPPUNIT_TEST(testStatisticalFormulaPoisson); - CPPUNIT_TEST(testMathFormulaSumSQ); - CPPUNIT_TEST(testStatisticalFormulaSkewp); - CPPUNIT_TEST(testMathFormulaSqrtPi); - CPPUNIT_TEST(testStatisticalFormulaBinomDist); - CPPUNIT_TEST(testStatisticalFormulaVarP); - CPPUNIT_TEST(testMathFormulaCeil); - // This test fails MacOS 10.8. Disabled temporarily - // CPPUNIT_TEST(testMathFormulaKombin); - CPPUNIT_TEST(testStatisticalFormulaDevSq); - CPPUNIT_TEST(testStatisticalFormulaStDev); - CPPUNIT_TEST(testStatisticalFormulaSlope); - CPPUNIT_TEST(testStatisticalFormulaSTEYX); - CPPUNIT_TEST(testStatisticalFormulaZTest); - CPPUNIT_TEST(testMathFormulaPi); - CPPUNIT_TEST(testMathFormulaRandom); - CPPUNIT_TEST(testMathFormulaConvert); - CPPUNIT_TEST(testMathFormulaProduct); - CPPUNIT_TEST(testStatisticalFormulaHypGeomDist); - CPPUNIT_TEST(testArrayFormulaSumX2MY2); - CPPUNIT_TEST(testArrayFormulaSumX2PY2); - CPPUNIT_TEST(testStatisticalFormulaBetainv); - CPPUNIT_TEST(testStatisticalFormulaTTest); - CPPUNIT_TEST(testStatisticalFormulaTDist); - CPPUNIT_TEST(testStatisticalFormulaTInv); - CPPUNIT_TEST(testArrayFormulaSumXMY2); - CPPUNIT_TEST(testStatisticalFormulaStDevP); - CPPUNIT_TEST(testStatisticalFormulaCovar); - CPPUNIT_TEST(testLogicalFormulaAnd); - CPPUNIT_TEST(testMathFormulaSumProduct); - CPPUNIT_TEST(testMathFormulaSumProduct2); - CPPUNIT_TEST(testStatisticalParallelCountBug); - CPPUNIT_TEST(testSpreadSheetFormulaVLookup); - CPPUNIT_TEST(testLogicalFormulaOr); - CPPUNIT_TEST(testLogicalFormulaNot); - CPPUNIT_TEST(testLogicalFormulaXor); - CPPUNIT_TEST(testDatabaseFormulaDmax); - CPPUNIT_TEST(testDatabaseFormulaDmin); - CPPUNIT_TEST(testDatabaseFormulaDproduct); - CPPUNIT_TEST(testDatabaseFormulaDaverage); - CPPUNIT_TEST(testDatabaseFormulaDstdev); - CPPUNIT_TEST(testDatabaseFormulaDstdevp); - CPPUNIT_TEST(testDatabaseFormulaDsum); - CPPUNIT_TEST(testDatabaseFormulaDvar); - CPPUNIT_TEST(testDatabaseFormulaDvarp); - CPPUNIT_TEST(testMathFormulaAverageIf); - CPPUNIT_TEST(testDatabaseFormulaDcount); - CPPUNIT_TEST(testDatabaseFormulaDcountA); - CPPUNIT_TEST(testMathFormulaDegrees); - CPPUNIT_TEST(testMathFormulaRoundUp); - CPPUNIT_TEST(testMathFormulaRoundDown); - CPPUNIT_TEST(testMathFormulaInt); - CPPUNIT_TEST(testMathFormulaRadians); - CPPUNIT_TEST(testMathFormulaCountIf); - CPPUNIT_TEST(testMathFormulaIsEven); - CPPUNIT_TEST(testMathFormulaIsOdd); - CPPUNIT_TEST(testMathFormulaFact); - CPPUNIT_TEST(testStatisticalFormulaMaxa); - CPPUNIT_TEST(testStatisticalFormulaMina); - CPPUNIT_TEST(testStatisticalFormulaCountA); - CPPUNIT_TEST(testStatisticalFormulaAverageA); - CPPUNIT_TEST(testStatisticalFormulaVarA); - CPPUNIT_TEST(testStatisticalFormulaVarPA); - CPPUNIT_TEST(testStatisticalFormulaStDevA); - CPPUNIT_TEST(testStatisticalFormulaStDevPA); - CPPUNIT_TEST(testMathFormulaSEC); - CPPUNIT_TEST(testMathFormulaSECH); - CPPUNIT_TEST(testMathFormulaMROUND); - CPPUNIT_TEST(testMathFormulaQuotient); - CPPUNIT_TEST(testMathFormulaSeriesSum); - CPPUNIT_TEST(testMathFormulaSumIf); - CPPUNIT_TEST(testAddInFormulaBesseLJ); - CPPUNIT_TEST(testNegSub); - CPPUNIT_TEST(testStatisticalFormulaAvedev); - CPPUNIT_TEST(testMathFormulaAverageIf_Mix); - CPPUNIT_TEST(testStatisticalFormulaKurt1); - CPPUNIT_TEST(testStatisticalFormulaHarMean1); - CPPUNIT_TEST(testStatisticalFormulaVarA1); - CPPUNIT_TEST(testStatisticalFormulaVarPA1); - CPPUNIT_TEST(testStatisticalFormulaStDevA1); - CPPUNIT_TEST(testStatisticalFormulaStDevPA1); - CPPUNIT_TEST(testFinancialMDurationFormula1); CPPUNIT_TEST_SUITE_END(); private: @@ -501,7 +276,7 @@ private: ScDocument* getScDoc2(); }; -void ScOpenCLTest::initTestEnv(std::u16string_view fileName) +void ScOpenCLTest1::initTestEnv(std::u16string_view fileName) { // Some documents contain macros, disable them, otherwise // the "Error, BASIC runtime error." dialog is prompted @@ -536,24 +311,24 @@ void ScOpenCLTest::initTestEnv(std::u16string_view fileName) CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), xFrames->getCount()); } -ScDocument* ScOpenCLTest::getScDoc2() +ScDocument* ScOpenCLTest1::getScDoc2() { ScModelObj* pModelObj = comphelper::getFromUnoTunnel<ScModelObj>(mxComponent2); CPPUNIT_ASSERT(pModelObj); return pModelObj->GetDocument(); } -void ScOpenCLTest::enableOpenCL() +void ScOpenCLTest1::enableOpenCL() { sc::FormulaGroupInterpreter::enableOpenCL_UnitTestsOnly(); } -void ScOpenCLTest::disableOpenCL() +void ScOpenCLTest1::disableOpenCL() { sc::FormulaGroupInterpreter::disableOpenCL_UnitTestsOnly(); } -void ScOpenCLTest::testCompilerHorizontal() +void ScOpenCLTest1::testCompilerHorizontal() { initTestEnv(u"ods/opencl/compiler/horizontal.ods"); ScDocument* pDoc = getScDoc(); @@ -575,7 +350,7 @@ void ScOpenCLTest::testCompilerHorizontal() } } -void ScOpenCLTest::testCompilerNested() +void ScOpenCLTest1::testCompilerNested() { initTestEnv(u"ods/opencl/compiler/nested.ods"); ScDocument* pDoc = getScDoc(); @@ -591,7 +366,7 @@ void ScOpenCLTest::testCompilerNested() } } -void ScOpenCLTest::testCompilerString() +void ScOpenCLTest1::testCompilerString() { initTestEnv(u"ods/opencl/compiler/string.ods"); ScDocument* pDoc = getScDoc(); @@ -611,7 +386,7 @@ void ScOpenCLTest::testCompilerString() } } -void ScOpenCLTest::testCompilerInEq() +void ScOpenCLTest1::testCompilerInEq() { initTestEnv(u"ods/opencl/compiler/ineq.ods"); ScDocument* pDoc = getScDoc(); @@ -627,7 +402,7 @@ void ScOpenCLTest::testCompilerInEq() } } -void ScOpenCLTest::testCompilerPrecision() +void ScOpenCLTest1::testCompilerPrecision() { initTestEnv(u"ods/opencl/compiler/precision.ods"); ScDocument* pDoc = getScDoc(); @@ -648,7 +423,7 @@ void ScOpenCLTest::testCompilerPrecision() } #if 0 -void ScOpenCLTest::testSharedFormulaXLSStockHistory() +void ScOpenCLTest1::testSharedFormulaXLSStockHistory() { initTestEnv(u"xls/stock-history.xls"); ScDocument* pDoc = getScDoc(); @@ -672,7 +447,7 @@ void ScOpenCLTest::testSharedFormulaXLSStockHistory() } } -void ScOpenCLTest::testSharedFormulaXLSGroundWater() +void ScOpenCLTest1::testSharedFormulaXLSGroundWater() { initTestEnv(u"xls/ground-water-daily.xls"); ScDocument* pDoc = getScDoc(); @@ -692,7 +467,7 @@ void ScOpenCLTest::testSharedFormulaXLSGroundWater() } #endif -void ScOpenCLTest::testSystematic() +void ScOpenCLTest1::testSystematic() { initTestEnv(u"xls/systematic.xls"); @@ -783,7 +558,7 @@ void ScOpenCLTest::testSystematic() } -void ScOpenCLTest::testSharedFormulaXLS() +void ScOpenCLTest1::testSharedFormulaXLS() { initTestEnv(u"xls/sum_ex.xls"); ScDocument* pDoc = getScDoc(); @@ -871,7 +646,7 @@ void ScOpenCLTest::testSharedFormulaXLS() } } -void ScOpenCLTest::testMathFormulaCos() +void ScOpenCLTest1::testMathFormulaCos() { initTestEnv(u"xls/opencl/math/cos.xls"); ScDocument* pDoc = getScDoc(); @@ -886,7 +661,7 @@ void ScOpenCLTest::testMathFormulaCos() } } -void ScOpenCLTest::testMathFormulaSinh() +void ScOpenCLTest1::testMathFormulaSinh() { initTestEnv(u"xls/opencl/math/sinh.xls"); ScDocument* pDoc = getScDoc(); @@ -902,37 +677,7 @@ void ScOpenCLTest::testMathFormulaSinh() } } -void ScOpenCLTest::testMathFormulaPi() -{ - initTestEnv(u"xls/opencl/math/pi.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - for (SCROW i = 0; i <= 15; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(0,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(0,i,0)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); - } -} - -void ScOpenCLTest::testMathFormulaRandom() -{ - initTestEnv(u"xls/opencl/math/random.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - for (SCROW i = 0; i <= 15; ++i) - { - pDoc->GetValue(ScAddress(0,i,0)); // LO - pDocRes->GetValue(ScAddress(0,i,0)); // Excel - //because the random numbers will always change,so give the test "true" - CPPUNIT_ASSERT(true); - } -} -void ScOpenCLTest::testFinacialFormula() +void ScOpenCLTest1::testFinacialFormula() { initTestEnv(u"xls/opencl/financial/general.xls"); ScDocument* pDoc = getScDoc(); @@ -1081,7 +826,7 @@ void ScOpenCLTest::testFinacialFormula() } } -void ScOpenCLTest::testStatisticalFormulaCorrel() +void ScOpenCLTest1::testStatisticalFormulaCorrel() { initTestEnv(u"ods/opencl/statistical/Correl.ods"); ScDocument* pDoc = getScDoc(); @@ -1096,7 +841,7 @@ void ScOpenCLTest::testStatisticalFormulaCorrel() CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } } -void ScOpenCLTest::testStatisticalFormulaFisher() +void ScOpenCLTest1::testStatisticalFormulaFisher() { initTestEnv(u"xls/opencl/statistical/Fisher.xls"); ScDocument* pDoc = getScDoc(); @@ -1112,7 +857,7 @@ void ScOpenCLTest::testStatisticalFormulaFisher() } } -void ScOpenCLTest::testStatisticalFormulaFisherInv() +void ScOpenCLTest1::testStatisticalFormulaFisherInv() { initTestEnv(u"xls/opencl/statistical/FisherInv.xls"); ScDocument* pDoc = getScDoc(); @@ -1128,7 +873,7 @@ void ScOpenCLTest::testStatisticalFormulaFisherInv() } } -void ScOpenCLTest::testStatisticalFormulaGamma() +void ScOpenCLTest1::testStatisticalFormulaGamma() { initTestEnv(u"xls/opencl/statistical/Gamma.xls"); ScDocument* pDoc = getScDoc(); @@ -1144,7 +889,7 @@ void ScOpenCLTest::testStatisticalFormulaGamma() } } -void ScOpenCLTest::testFinacialFvscheduleFormula() +void ScOpenCLTest1::testFinacialFvscheduleFormula() { initTestEnv(u"xls/opencl/financial/Fvschedule.xls"); ScDocument* pDoc = getScDoc(); @@ -1159,7 +904,7 @@ void ScOpenCLTest::testFinacialFvscheduleFormula() } } -void ScOpenCLTest::testMathFormulaAbs() +void ScOpenCLTest1::testMathFormulaAbs() { initTestEnv(u"ods/opencl/math/Abs.ods"); ScDocument* pDoc = getScDoc(); @@ -1175,7 +920,7 @@ void ScOpenCLTest::testMathFormulaAbs() } } -void ScOpenCLTest::testFinacialSYDFormula() +void ScOpenCLTest1::testFinacialSYDFormula() { initTestEnv(u"xls/opencl/financial/SYD.xls"); ScDocument* pDoc = getScDoc(); @@ -1192,7 +937,7 @@ void ScOpenCLTest::testFinacialSYDFormula() // this test has intermittent failures on OSX #if !defined MACOSX -void ScOpenCLTest::testFinacialIRRFormula() +void ScOpenCLTest1::testFinacialIRRFormula() { initTestEnv(u"xls/opencl/financial/IRR.xls"); ScDocument* pDoc = getScDoc(); @@ -1208,7 +953,7 @@ void ScOpenCLTest::testFinacialIRRFormula() } #endif -void ScOpenCLTest::testStatisticalFormulaGammaLn() +void ScOpenCLTest1::testStatisticalFormulaGammaLn() { initTestEnv(u"xls/opencl/statistical/GammaLn.xls"); ScDocument* pDoc = getScDoc(); @@ -1224,7 +969,7 @@ void ScOpenCLTest::testStatisticalFormulaGammaLn() } } -void ScOpenCLTest::testStatisticalFormulaGauss() +void ScOpenCLTest1::testStatisticalFormulaGauss() { initTestEnv(u"xls/opencl/statistical/Gauss.xls"); ScDocument* pDoc = getScDoc(); @@ -1240,7 +985,7 @@ void ScOpenCLTest::testStatisticalFormulaGauss() } } -void ScOpenCLTest::testStatisticalFormulaGeoMean() +void ScOpenCLTest1::testStatisticalFormulaGeoMean() { initTestEnv(u"xls/opencl/statistical/GeoMean.xls"); ScDocument* pDoc = getScDoc(); @@ -1256,7 +1001,7 @@ void ScOpenCLTest::testStatisticalFormulaGeoMean() } } -void ScOpenCLTest::testStatisticalFormulaHarMean() +void ScOpenCLTest1::testStatisticalFormulaHarMean() { initTestEnv(u"xls/opencl/statistical/HarMean.xls"); ScDocument* pDoc = getScDoc(); @@ -1272,7 +1017,7 @@ void ScOpenCLTest::testStatisticalFormulaHarMean() } } -void ScOpenCLTest::testFinacialSLNFormula() +void ScOpenCLTest1::testFinacialSLNFormula() { initTestEnv(u"xls/opencl/financial/SLN.xls"); ScDocument* pDoc = getScDoc(); @@ -1287,7 +1032,7 @@ void ScOpenCLTest::testFinacialSLNFormula() } } -void ScOpenCLTest::testFinacialMIRRFormula() +void ScOpenCLTest1::testFinacialMIRRFormula() { initTestEnv(u"xls/opencl/financial/MIRR.xls"); ScDocument* pDoc = getScDoc(); @@ -1302,7 +1047,7 @@ void ScOpenCLTest::testFinacialMIRRFormula() } } -void ScOpenCLTest::testFinancialCoupdaybsFormula() +void ScOpenCLTest1::testFinancialCoupdaybsFormula() { initTestEnv(u"xls/opencl/financial/Coupdaybs.xls"); ScDocument* pDoc = getScDoc(); @@ -1317,7 +1062,7 @@ void ScOpenCLTest::testFinancialCoupdaybsFormula() } } -void ScOpenCLTest::testFinacialDollardeFormula() +void ScOpenCLTest1::testFinacialDollardeFormula() { initTestEnv(u"xls/opencl/financial/Dollarde.xls"); ScDocument* pDoc = getScDoc(); @@ -1332,7 +1077,7 @@ void ScOpenCLTest::testFinacialDollardeFormula() } } -void ScOpenCLTest::testFinancialCoupdaysFormula() +void ScOpenCLTest1::testFinancialCoupdaysFormula() { initTestEnv(u"xls/opencl/financial/Coupdays.xls"); ScDocument* pDoc = getScDoc(); @@ -1348,7 +1093,7 @@ void ScOpenCLTest::testFinancialCoupdaysFormula() } -void ScOpenCLTest::testFinancialCoupdaysncFormula() +void ScOpenCLTest1::testFinancialCoupdaysncFormula() { initTestEnv(u"xls/opencl/financial/Coupdaysnc.xls"); ScDocument* pDoc = getScDoc(); @@ -1362,7 +1107,7 @@ void ScOpenCLTest::testFinancialCoupdaysncFormula() CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } } -void ScOpenCLTest::testFinacialRateFormula() +void ScOpenCLTest1::testFinacialRateFormula() { initTestEnv(u"xls/opencl/financial/RATE.xls"); ScDocument* pDoc = getScDoc(); @@ -1377,7 +1122,7 @@ void ScOpenCLTest::testFinacialRateFormula() } } -void ScOpenCLTest::testFinancialAccrintmFormula() +void ScOpenCLTest1::testFinancialAccrintmFormula() { initTestEnv(u"xls/opencl/financial/Accrintm.xls"); ScDocument* pDoc = getScDoc(); @@ -1392,7 +1137,7 @@ void ScOpenCLTest::testFinancialAccrintmFormula() } } -void ScOpenCLTest::testFinancialCoupnumFormula() +void ScOpenCLTest1::testFinancialCoupnumFormula() { initTestEnv(u"xls/opencl/financial/Coupnum.xls"); ScDocument* pDoc = getScDoc(); @@ -1407,7 +1152,7 @@ void ScOpenCLTest::testFinancialCoupnumFormula() } } -void ScOpenCLTest::testStatisticalFormulaNegbinomdist() +void ScOpenCLTest1::testStatisticalFormulaNegbinomdist() { initTestEnv(u"xls/opencl/statistical/Negbinomdist.xls"); ScDocument* pDoc = getScDoc(); @@ -1423,7 +1168,7 @@ void ScOpenCLTest::testStatisticalFormulaNegbinomdist() } } -void ScOpenCLTest::testMathFormulaSin() +void ScOpenCLTest1::testMathFormulaSin() { initTestEnv(u"xls/opencl/math/sin.xls"); ScDocument* pDoc = getScDoc(); @@ -1438,22 +1183,7 @@ void ScOpenCLTest::testMathFormulaSin() } } -void ScOpenCLTest::testMathFormulaSumSQ() -{ - initTestEnv(u"xls/opencl/math/sumsq.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - for (SCROW i = 0; i < 20; ++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)); - } -} - -void ScOpenCLTest::testMathFormulaTan() +void ScOpenCLTest1::testMathFormulaTan() { initTestEnv(u"xls/opencl/math/tan.xls"); ScDocument* pDoc = getScDoc(); @@ -1468,7 +1198,7 @@ void ScOpenCLTest::testMathFormulaTan() } } -void ScOpenCLTest::testMathFormulaTanH() +void ScOpenCLTest1::testMathFormulaTanH() { initTestEnv(u"xls/opencl/math/tanh.xls"); ScDocument* pDoc = getScDoc(); @@ -1483,7 +1213,7 @@ void ScOpenCLTest::testMathFormulaTanH() } } -void ScOpenCLTest::testMathFormulaSqrt() +void ScOpenCLTest1::testMathFormulaSqrt() { initTestEnv(u"xls/opencl/math/sqrt.xls"); ScDocument* pDoc = getScDoc(); @@ -1498,7 +1228,7 @@ void ScOpenCLTest::testMathFormulaSqrt() } } -void ScOpenCLTest::testFinacialPriceFormula() +void ScOpenCLTest1::testFinacialPriceFormula() { initTestEnv(u"xls/opencl/financial/Price.xls"); ScDocument* pDoc = getScDoc(); @@ -1513,7 +1243,7 @@ void ScOpenCLTest::testFinacialPriceFormula() } } -void ScOpenCLTest::testFinacialDollarfrFormula() +void ScOpenCLTest1::testFinacialDollarfrFormula() { initTestEnv(u"xls/opencl/financial/Dollarfr.xls"); ScDocument* pDoc = getScDoc(); @@ -1528,7 +1258,7 @@ void ScOpenCLTest::testFinacialDollarfrFormula() } } -void ScOpenCLTest::testFinacialPriceDiscFormula() +void ScOpenCLTest1::testFinacialPriceDiscFormula() { initTestEnv(u"xls/opencl/financial/PriceDisc.xls"); ScDocument* pDoc = getScDoc(); @@ -1543,7 +1273,7 @@ void ScOpenCLTest::testFinacialPriceDiscFormula() } } -void ScOpenCLTest::testFinacialODDLPRICEFormula() +void ScOpenCLTest1::testFinacialODDLPRICEFormula() { initTestEnv(u"xls/opencl/financial/Oddlprice.xls"); ScDocument* pDoc = getScDoc(); @@ -1558,7 +1288,7 @@ void ScOpenCLTest::testFinacialODDLPRICEFormula() } } -void ScOpenCLTest:: testFinacialOddlyieldFormula() +void ScOpenCLTest1:: testFinacialOddlyieldFormula() { initTestEnv(u"xls/opencl/financial/Oddlyield.xls"); ScDocument* pDoc = getScDoc(); @@ -1573,7 +1303,7 @@ void ScOpenCLTest:: testFinacialOddlyieldFormula() } } -void ScOpenCLTest::testFinacialDISCFormula() +void ScOpenCLTest1::testFinacialDISCFormula() { initTestEnv(u"xls/opencl/financial/DISC.xls"); ScDocument* pDoc = getScDoc(); @@ -1588,7 +1318,7 @@ void ScOpenCLTest::testFinacialDISCFormula() } } -void ScOpenCLTest:: testFinacialPVFormula() +void ScOpenCLTest1:: testFinacialPVFormula() { initTestEnv(u"xls/opencl/financial/PV.xls"); ScDocument* pDoc = getScDoc(); @@ -1603,7 +1333,7 @@ void ScOpenCLTest:: testFinacialPVFormula() } } -void ScOpenCLTest::testFinacialINTRATEFormula() +void ScOpenCLTest1::testFinacialINTRATEFormula() { initTestEnv(u"xls/opencl/financial/INTRATE.xls"); ScDocument* pDoc = getScDoc(); @@ -1618,7 +1348,7 @@ void ScOpenCLTest::testFinacialINTRATEFormula() } } -void ScOpenCLTest::testStatisticalFormulaStandard() +void ScOpenCLTest1::testStatisticalFormulaStandard() { initTestEnv(u"xls/opencl/statistical/Standard.xls"); ScDocument* pDoc = getScDoc(); @@ -1634,7 +1364,7 @@ void ScOpenCLTest::testStatisticalFormulaStandard() } } -void ScOpenCLTest::testStatisticalFormulaWeibull() +void ScOpenCLTest1::testStatisticalFormulaWeibull() { initTestEnv(u"xls/opencl/statistical/Weibull.xls"); ScDocument* pDoc = getScDoc(); @@ -1651,55 +1381,7 @@ void ScOpenCLTest::testStatisticalFormulaWeibull() } } -void ScOpenCLTest::testStatisticalFormulaVar() -{ - initTestEnv(u"xls/opencl/statistical/Var.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Check the results of formula cells in the shared formula range. - for (SCROW i = 1; i <= 20; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(1,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(1,i,0)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); - } -} - -void ScOpenCLTest::testStatisticalFormulaSkew() -{ - initTestEnv(u"xls/opencl/statistical/Skew.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Check the results of formula cells in the shared formula range. - for (SCROW i = 1; i <= 20; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(1,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(1,i,0)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); - } -} - -void ScOpenCLTest::testStatisticalFormulaSkewp() -{ - initTestEnv(u"xls/opencl/statistical/Skewp.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Check the results of formula cells in the shared formula range. - for (SCROW i = 1; i <= 20; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(1,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(1,i,0)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); - } -} - -void ScOpenCLTest::testStatisticalFormulaPearson() +void ScOpenCLTest1::testStatisticalFormulaPearson() { initTestEnv(u"xls/opencl/statistical/Pearson.xls"); ScDocument* pDoc = getScDoc(); @@ -1715,7 +1397,7 @@ void ScOpenCLTest::testStatisticalFormulaPearson() } } -void ScOpenCLTest::testStatisticalFormulaRsq() +void ScOpenCLTest1::testStatisticalFormulaRsq() { initTestEnv(u"xls/opencl/statistical/Rsq.xls"); ScDocument* pDoc = getScDoc(); @@ -1731,22 +1413,7 @@ void ScOpenCLTest::testStatisticalFormulaRsq() } } -void ScOpenCLTest::testMathFormulaTrunc() -{ - initTestEnv(u"xls/opencl/math/trunc.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - for (SCROW i = 0; i <= 15; ++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)); - } -} - -void ScOpenCLTest::testMathFormulaCosh() +void ScOpenCLTest1::testMathFormulaCosh() { initTestEnv(u"xls/opencl/math/cosh.xls"); ScDocument* pDoc = getScDoc(); @@ -1760,23 +1427,8 @@ void ScOpenCLTest::testMathFormulaCosh() CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } } -void ScOpenCLTest::testStatisticalFormulaCovar() -{ - initTestEnv(u"xls/opencl/statistical/Covar.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Check the results of formula cells in the shared formula range. - for (SCROW i = 0; i <= 16; ++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)); - } -} -void ScOpenCLTest::testStatisticalFormulaKurt() +void ScOpenCLTest1::testStatisticalFormulaKurt() { initTestEnv(u"xls/opencl/statistical/Kurt.xls"); ScDocument* pDoc = getScDoc(); @@ -1792,7 +1444,7 @@ void ScOpenCLTest::testStatisticalFormulaKurt() } } -void ScOpenCLTest::testMathFormulaCot() +void ScOpenCLTest1::testMathFormulaCot() { initTestEnv(u"ods/opencl/math/cot.ods"); ScDocument* pDoc = getScDoc(); @@ -1807,23 +1459,7 @@ void ScOpenCLTest::testMathFormulaCot() } } -void ScOpenCLTest::testStatisticalFormulaDevSq() -{ - initTestEnv(u"xls/opencl/statistical/DevSq.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Check the results of formula cells in the shared formula range. - for (SCROW i = 0; i <= 11; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(1,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(1,i,0)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); - } -} - -void ScOpenCLTest::testMathFormulaCsc() +void ScOpenCLTest1::testMathFormulaCsc() { initTestEnv(u"ods/opencl/math/csc.ods"); ScDocument* pDoc = getScDoc(); @@ -1838,7 +1474,7 @@ void ScOpenCLTest::testMathFormulaCsc() } } -void ScOpenCLTest::testMathFormulaCoth() +void ScOpenCLTest1::testMathFormulaCoth() { initTestEnv(u"ods/opencl/math/coth.ods"); ScDocument* pDoc = getScDoc(); @@ -1853,7 +1489,7 @@ void ScOpenCLTest::testMathFormulaCoth() } } -void ScOpenCLTest::testFinacialXNPVFormula() +void ScOpenCLTest1::testFinacialXNPVFormula() { initTestEnv(u"xls/opencl/financial/XNPV.xls"); ScDocument* pDoc = getScDoc(); @@ -1875,7 +1511,7 @@ void ScOpenCLTest::testFinacialXNPVFormula() } } -void ScOpenCLTest::testStatisticalFormulaIntercept() +void ScOpenCLTest1::testStatisticalFormulaIntercept() { initTestEnv(u"xls/opencl/statistical/Intercept.xls"); ScDocument* pDoc = getScDoc(); @@ -1890,7 +1526,7 @@ void ScOpenCLTest::testStatisticalFormulaIntercept() } } -void ScOpenCLTest::testFinancialAmordegrcFormula() +void ScOpenCLTest1::testFinancialAmordegrcFormula() { initTestEnv(u"xls/opencl/financial/Amordegrc.xls"); ScDocument* pDoc = getScDoc(); @@ -1905,7 +1541,7 @@ void ScOpenCLTest::testFinancialAmordegrcFormula() } } -void ScOpenCLTest:: testFinancialISPMTFormula() +void ScOpenCLTest1:: testFinancialISPMTFormula() { initTestEnv(u"xls/opencl/financial/ISPMT.xls"); ScDocument* pDoc = getScDoc(); @@ -1920,7 +1556,7 @@ void ScOpenCLTest:: testFinancialISPMTFormula() } } -void ScOpenCLTest::testStatisticalFormulaMedian() +void ScOpenCLTest1::testStatisticalFormulaMedian() { initTestEnv(u"xls/opencl/statistical/Median.xls"); ScDocument* pDoc = getScDoc(); @@ -1936,7 +1572,7 @@ void ScOpenCLTest::testStatisticalFormulaMedian() } } -void ScOpenCLTest::testStatisticalFormulaNormdist() +void ScOpenCLTest1::testStatisticalFormulaNormdist() { initTestEnv(u"xls/opencl/statistical/Normdist.xls"); ScDocument* pDoc = getScDoc(); @@ -1952,7 +1588,7 @@ void ScOpenCLTest::testStatisticalFormulaNormdist() } } -void ScOpenCLTest::testStatisticalFormulaNormsdist() +void ScOpenCLTest1::testStatisticalFormulaNormsdist() { initTestEnv(u"xls/opencl/statistical/Normsdist.xls"); ScDocument* pDoc = getScDoc(); @@ -1968,7 +1604,7 @@ void ScOpenCLTest::testStatisticalFormulaNormsdist() } } -void ScOpenCLTest::testStatisticalFormulaPermut() +void ScOpenCLTest1::testStatisticalFormulaPermut() { initTestEnv(u"xls/opencl/statistical/Permut.xls"); ScDocument* pDoc = getScDoc(); @@ -1984,7 +1620,7 @@ void ScOpenCLTest::testStatisticalFormulaPermut() } } -void ScOpenCLTest::testStatisticalFormulaPermutation() +void ScOpenCLTest1::testStatisticalFormulaPermutation() { initTestEnv(u"xls/opencl/statistical/Permutation.xls"); ScDocument* pDoc = getScDoc(); @@ -2000,7 +1636,7 @@ void ScOpenCLTest::testStatisticalFormulaPermutation() } } -void ScOpenCLTest::testStatisticalFormulaPhi() +void ScOpenCLTest1::testStatisticalFormulaPhi() { initTestEnv(u"xls/opencl/statistical/Phi.xls"); ScDocument* pDoc = getScDoc(); @@ -2016,22 +1652,7 @@ void ScOpenCLTest::testStatisticalFormulaPhi() } } -void ScOpenCLTest::testMathFormulaCscH() -{ - initTestEnv(u"ods/opencl/math/csch.ods"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - for (SCROW i = 0; i <= 15; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(1,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(1,i,0)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); - } -} - -void ScOpenCLTest::testStatisticalFormulaLogInv() +void ScOpenCLTest1::testStatisticalFormulaLogInv() { initTestEnv(u"xls/opencl/statistical/LogInv.xls"); ScDocument* pDoc = getScDoc(); @@ -2047,7 +1668,7 @@ void ScOpenCLTest::testStatisticalFormulaLogInv() } } -void ScOpenCLTest::testFinacialNPERFormula() +void ScOpenCLTest1::testFinacialNPERFormula() { initTestEnv(u"xls/opencl/financial/NPER.xls"); ScDocument* pDoc = getScDoc(); @@ -2062,7 +1683,7 @@ void ScOpenCLTest::testFinacialNPERFormula() } } -void ScOpenCLTest::testStatisticalFormulaForecast() +void ScOpenCLTest1::testStatisticalFormulaForecast() { initTestEnv(u"xls/opencl/statistical/Forecast.xls"); ScDocument* pDoc = getScDoc(); @@ -2078,7 +1699,7 @@ void ScOpenCLTest::testStatisticalFormulaForecast() } } -void ScOpenCLTest::testFinancialAmorlincFormula() +void ScOpenCLTest1::testFinancialAmorlincFormula() { initTestEnv(u"xls/opencl/financial/Amorlinc.xls"); ScDocument* pDoc = getScDoc(); @@ -2093,7 +1714,7 @@ void ScOpenCLTest::testFinancialAmorlincFormula() } } -void ScOpenCLTest::testFinancialDDBFormula() +void ScOpenCLTest1::testFinancialDDBFormula() { initTestEnv(u"xls/opencl/financial/ddb.xls"); ScDocument* pDoc = getScDoc(); @@ -2107,7 +1728,7 @@ void ScOpenCLTest::testFinancialDDBFormula() CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } } -void ScOpenCLTest::testFinacialPriceMatFormula() +void ScOpenCLTest1::testFinacialPriceMatFormula() { initTestEnv(u"xls/opencl/financial/PriceMat.xls"); ScDocument* pDoc = getScDoc(); @@ -2121,7 +1742,7 @@ void ScOpenCLTest::testFinacialPriceMatFormula() CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } } -void ScOpenCLTest::testFinacialFormulaReceived() +void ScOpenCLTest1::testFinacialFormulaReceived() { initTestEnv(u"xls/opencl/financial/Received.xls"); ScDocument* pDoc = getScDoc(); @@ -2136,7 +1757,7 @@ void ScOpenCLTest::testFinacialFormulaReceived() CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } } -void ScOpenCLTest::testFinancialFormulaCumipmt() +void ScOpenCLTest1::testFinancialFormulaCumipmt() { initTestEnv(u"xls/opencl/financial/Cumipmt.xls"); ScDocument* pDoc = getScDoc(); @@ -2151,7 +1772,7 @@ void ScOpenCLTest::testFinancialFormulaCumipmt() CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } } -void ScOpenCLTest::testFinancialFormulaCumprinc() +void ScOpenCLTest1::testFinancialFormulaCumprinc() { initTestEnv(u"xls/opencl/financial/Cumprinc.xls"); ScDocument* pDoc = getScDoc(); @@ -2166,7 +1787,7 @@ void ScOpenCLTest::testFinancialFormulaCumprinc() CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } } -void ScOpenCLTest::testFinacialRRIFormula() +void ScOpenCLTest1::testFinacialRRIFormula() { initTestEnv(u"xls/opencl/financial/RRI.xls"); ScDocument* pDoc = getScDoc(); @@ -2180,7 +1801,7 @@ void ScOpenCLTest::testFinacialRRIFormula() CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } } -void ScOpenCLTest::testFinacialEFFECT_ADDFormula() +void ScOpenCLTest1::testFinacialEFFECT_ADDFormula() { initTestEnv(u"xls/opencl/financial/EFFECT_ADD.xls"); ScDocument* pDoc = getScDoc(); @@ -2194,7 +1815,7 @@ void ScOpenCLTest::testFinacialEFFECT_ADDFormula() CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } } -void ScOpenCLTest::testFinacialNominalFormula() +void ScOpenCLTest1::testFinacialNominalFormula() { initTestEnv(u"xls/opencl/financial/Nominal.xls"); ScDocument* pDoc = getScDoc(); @@ -2210,7 +1831,7 @@ void ScOpenCLTest::testFinacialNominalFormula() CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } } -void ScOpenCLTest::testFinacialTBILLEQFormula() +void ScOpenCLTest1::testFinacialTBILLEQFormula() { initTestEnv(u"xls/opencl/financial/TBILLEQ.xls"); ScDocument* pDoc = getScDoc(); @@ -2224,7 +1845,7 @@ void ScOpenCLTest::testFinacialTBILLEQFormula() CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } } -void ScOpenCLTest::testFinacialTBILLPRICEFormula() +void ScOpenCLTest1::testFinacialTBILLPRICEFormula() { initTestEnv(u"xls/opencl/financial/TBILLPRICE.xls"); ScDocument* pDoc = getScDoc(); @@ -2238,7 +1859,7 @@ void ScOpenCLTest::testFinacialTBILLPRICEFormula() CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } } -void ScOpenCLTest::testFinacialTBILLYIELDFormula() +void ScOpenCLTest1::testFinacialTBILLYIELDFormula() { initTestEnv(u"xls/opencl/financial/TBILLYIELD.xls"); ScDocument* pDoc = getScDoc(); @@ -2252,7 +1873,7 @@ void ScOpenCLTest::testFinacialTBILLYIELDFormula() CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } } -void ScOpenCLTest::testFinacialYIELDFormula() +void ScOpenCLTest1::testFinacialYIELDFormula() { initTestEnv(u"xls/opencl/financial/YIELD.xls"); ScDocument* pDoc = getScDoc(); @@ -2267,7 +1888,7 @@ void ScOpenCLTest::testFinacialYIELDFormula() } } -void ScOpenCLTest::testFinacialYIELDDISCFormula() +void ScOpenCLTest1::testFinacialYIELDDISCFormula() { initTestEnv(u"xls/opencl/financial/YIELDDISC.xls"); ScDocument* pDoc = getScDoc(); @@ -2282,7 +1903,7 @@ void ScOpenCLTest::testFinacialYIELDDISCFormula() } } -void ScOpenCLTest::testFinacialYIELDMATFormula() +void ScOpenCLTest1::testFinacialYIELDMATFormula() { initTestEnv(u"xls/opencl/financial/YIELDMAT.xls"); ScDocument* pDoc = getScDoc(); @@ -2296,7 +1917,7 @@ void ScOpenCLTest::testFinacialYIELDMATFormula() CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } } -void ScOpenCLTest:: testFinacialPMTFormula() +void ScOpenCLTest1:: testFinacialPMTFormula() { initTestEnv(u"xls/opencl/financial/PMT.xls"); ScDocument* pDoc = getScDoc(); @@ -2311,7 +1932,7 @@ void ScOpenCLTest:: testFinacialPMTFormula() } } -void ScOpenCLTest:: testFinancialDurationFormula() +void ScOpenCLTest1:: testFinancialDurationFormula() { initTestEnv(u"ods/opencl/financial/Duration.ods"); ScDocument* pDoc = getScDoc(); @@ -2326,7 +1947,7 @@ void ScOpenCLTest:: testFinancialDurationFormula() } } -void ScOpenCLTest::testStatisticalFormulaLogNormDist() +void ScOpenCLTest1::testStatisticalFormulaLogNormDist() { initTestEnv(u"ods/opencl/statistical/LogNormDist.ods"); ScDocument* pDoc = getScDoc(); @@ -2342,7 +1963,7 @@ void ScOpenCLTest::testStatisticalFormulaLogNormDist() } } -void ScOpenCLTest::testMathFormulaArcCos() +void ScOpenCLTest1::testMathFormulaArcCos() { initTestEnv(u"ods/opencl/math/ArcCos.ods"); ScDocument* pDoc = getScDoc(); @@ -2358,22 +1979,7 @@ void ScOpenCLTest::testMathFormulaArcCos() } } -void ScOpenCLTest::testMathFormulaPower() -{ - initTestEnv(u"ods/opencl/math/power.ods"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - for (SCROW i = 0; i <= 15; ++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)); - } -} - -void ScOpenCLTest:: testFinacialPPMTFormula() +void ScOpenCLTest1:: testFinacialPPMTFormula() { initTestEnv(u"xls/opencl/financial/PPMT.xls"); ScDocument* pDoc = getScDoc(); @@ -2388,7 +1994,7 @@ void ScOpenCLTest:: testFinacialPPMTFormula() } } -void ScOpenCLTest:: testFinacialNPVFormula() +void ScOpenCLTest1:: testFinacialNPVFormula() { initTestEnv(u"xls/opencl/financial/NPV.xls"); ScDocument* pDoc = getScDoc(); @@ -2403,7 +2009,7 @@ void ScOpenCLTest:: testFinacialNPVFormula() } } -void ScOpenCLTest:: testFinancialDuration_ADDFormula() +void ScOpenCLTest1:: testFinancialDuration_ADDFormula() { initTestEnv(u"xls/opencl/financial/Duration_ADD.xls"); ScDocument* pDoc = getScDoc(); @@ -2418,7 +2024,7 @@ void ScOpenCLTest:: testFinancialDuration_ADDFormula() } } -void ScOpenCLTest::testStatisticalFormulaNorminv() +void ScOpenCLTest1::testStatisticalFormulaNorminv() { initTestEnv(u"xls/opencl/statistical/Norminv.xls"); ScDocument* pDoc = getScDoc(); @@ -2434,7 +2040,7 @@ void ScOpenCLTest::testStatisticalFormulaNorminv() } } -void ScOpenCLTest::testStatisticalFormulaNormsinv() +void ScOpenCLTest1::testStatisticalFormulaNormsinv() { initTestEnv(u"xls/opencl/statistical/Normsinv.xls"); ScDocument* pDoc = getScDoc(); @@ -2450,7 +2056,7 @@ void ScOpenCLTest::testStatisticalFormulaNormsinv() } } -void ScOpenCLTest::testMathFormulaArcCosHyp() +void ScOpenCLTest1::testMathFormulaArcCosHyp() { initTestEnv(u"ods/opencl/math/ArcCosHyp.ods"); ScDocument* pDoc = getScDoc(); @@ -2466,7 +2072,7 @@ void ScOpenCLTest::testMathFormulaArcCosHyp() } } -void ScOpenCLTest:: testFinancialMDurationFormula() +void ScOpenCLTest1:: testFinancialMDurationFormula() { initTestEnv(u"xls/opencl/financial/MDuration.xls"); ScDocument* pDoc = getScDoc(); @@ -2481,7 +2087,7 @@ void ScOpenCLTest:: testFinancialMDurationFormula() } } -void ScOpenCLTest::testMathFormulaArcCot() +void ScOpenCLTest1::testMathFormulaArcCot() { initTestEnv(u"ods/opencl/math/ArcCot.ods"); ScDocument* pDoc = getScDoc(); @@ -2497,7 +2103,7 @@ void ScOpenCLTest::testMathFormulaArcCot() } } -void ScOpenCLTest:: testFinancialFVFormula() +void ScOpenCLTest1:: testFinancialFVFormula() { initTestEnv(u"xls/opencl/financial/FV.xls"); ScDocument* pDoc = getScDoc(); @@ -2512,7 +2118,7 @@ void ScOpenCLTest:: testFinancialFVFormula() } } -void ScOpenCLTest::testFinancialDBFormula() +void ScOpenCLTest1::testFinancialDBFormula() { initTestEnv(u"xls/opencl/financial/db.xls"); ScDocument* pDoc = getScDoc(); @@ -2527,7 +2133,7 @@ void ScOpenCLTest::testFinancialDBFormula() } } -void ScOpenCLTest::testFinancialCouppcdFormula() +void ScOpenCLTest1::testFinancialCouppcdFormula() { initTestEnv(u"xls/opencl/financial/Couppcd.xls"); ScDocument* pDoc = getScDoc(); @@ -2542,7 +2148,7 @@ void ScOpenCLTest::testFinancialCouppcdFormula() } } -void ScOpenCLTest::testMathSumIfsFormula() +void ScOpenCLTest1::testMathSumIfsFormula() { initTestEnv(u"xls/opencl/math/sumifs.xls"); ScDocument* pDoc = getScDoc(); @@ -2576,7 +2182,7 @@ void ScOpenCLTest::testMathSumIfsFormula() } } -void ScOpenCLTest::testMathFormulaArcCotHyp() +void ScOpenCLTest1::testMathFormulaArcCotHyp() { initTestEnv(u"ods/opencl/math/ArcCotHyp.ods"); ScDocument* pDoc = getScDoc(); @@ -2592,7 +2198,7 @@ void ScOpenCLTest::testMathFormulaArcCotHyp() } } -void ScOpenCLTest::testMathFormulaArcSin() +void ScOpenCLTest1::testMathFormulaArcSin() { initTestEnv(u"ods/opencl/math/ArcSin.ods"); ScDocument* pDoc = getScDoc(); @@ -2608,7 +2214,7 @@ void ScOpenCLTest::testMathFormulaArcSin() } } -void ScOpenCLTest:: testFinancialVDBFormula() +void ScOpenCLTest1:: testFinancialVDBFormula() { initTestEnv(u"xls/opencl/financial/VDB.xls"); ScDocument* pDoc = getScDoc(); @@ -2635,7 +2241,7 @@ void ScOpenCLTest:: testFinancialVDBFormula() } } -void ScOpenCLTest:: testFinancialIPMTFormula() +void ScOpenCLTest1:: testFinancialIPMTFormula() { initTestEnv(u"xls/opencl/financial/IPMT.xls"); ScDocument* pDoc = getScDoc(); @@ -2650,29 +2256,7 @@ void ScOpenCLTest:: testFinancialIPMTFormula() } } -void ScOpenCLTest::testStatisticalFormulaChiSqDist() -{ - initTestEnv(u"ods/opencl/statistical/CHISQDIST.ods"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Check the results of formula cells in the shared formula range. - for (SCROW i = 1; i <= 9; ++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)); - } - for (SCROW i = 1; i <= 9; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(3,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(3,i,0)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); - } -} - -void ScOpenCLTest::testStatisticalFormulaConfidence() +void ScOpenCLTest1::testStatisticalFormulaConfidence() { initTestEnv(u"xls/opencl/statistical/Confidence.xls"); ScDocument* pDoc = getScDoc(); @@ -2688,23 +2272,7 @@ void ScOpenCLTest::testStatisticalFormulaConfidence() } } -void ScOpenCLTest::testStatisticalFormulaFDist() -{ - initTestEnv(u"xls/opencl/statistical/Fdist.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Check the results of formula cells in the shared formula range. - for (SCROW i = 0; i <= 9; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(3,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(3,i,0)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); - } -} - -void ScOpenCLTest::testFinancialCoupncdFormula() +void ScOpenCLTest1::testFinancialCoupncdFormula() { initTestEnv(u"xls/opencl/financial/Coupncd.xls"); ScDocument* pDoc = getScDoc(); @@ -2719,7 +2287,7 @@ void ScOpenCLTest::testFinancialCoupncdFormula() } } -void ScOpenCLTest::testFinancialAccrintFormula() +void ScOpenCLTest1::testFinancialAccrintFormula() { initTestEnv(u"xls/opencl/financial/Accrint.xls"); ScDocument* pDoc = getScDoc(); @@ -2734,7 +2302,7 @@ void ScOpenCLTest::testFinancialAccrintFormula() } } -void ScOpenCLTest::testStatisticalFormulaCritBinom() +void ScOpenCLTest1::testStatisticalFormulaCritBinom() { initTestEnv(u"xls/opencl/statistical/CritBinom.xls"); ScDocument* pDoc = getScDoc(); @@ -2750,7 +2318,7 @@ void ScOpenCLTest::testStatisticalFormulaCritBinom() } } -void ScOpenCLTest::testMathFormulaArcSinHyp() +void ScOpenCLTest1::testMathFormulaArcSinHyp() { initTestEnv(u"ods/opencl/math/ArcSinHyp.ods"); ScDocument* pDoc = getScDoc(); @@ -2766,7 +2334,7 @@ void ScOpenCLTest::testMathFormulaArcSinHyp() } } -void ScOpenCLTest::testMathFormulaArcTan() +void ScOpenCLTest1::testMathFormulaArcTan() { initTestEnv(u"ods/opencl/math/ArcTan.ods"); ScDocument* pDoc = getScDoc(); @@ -2782,7 +2350,7 @@ void ScOpenCLTest::testMathFormulaArcTan() } } -void ScOpenCLTest::testMathFormulaArcTanHyp() +void ScOpenCLTest1::testMathFormulaArcTanHyp() { initTestEnv(u"ods/opencl/math/ArcTanHyp.ods"); ScDocument* pDoc = getScDoc(); @@ -2798,7 +2366,7 @@ void ScOpenCLTest::testMathFormulaArcTanHyp() } } -void ScOpenCLTest:: testFinacialNPER1Formula() +void ScOpenCLTest1:: testFinacialNPER1Formula() { initTestEnv(u"xls/opencl/financial/NPER1.xls"); ScDocument* pDoc = getScDoc(); @@ -2813,39 +2381,7 @@ void ScOpenCLTest:: testFinacialNPER1Formula() } } -void ScOpenCLTest::testMathFormulaArcTan2() -{ - initTestEnv(u"ods/opencl/math/ArcTan2.ods"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Verify ATan2 Function - for (SCROW i = 1; i <= 17; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(2,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(2,i,0)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, 0.000001); - } -} - -void ScOpenCLTest::testStatisticalFormulaChiSqInv() -{ - initTestEnv(u"ods/opencl/statistical/CHISQINV.ods"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Check the results of formula cells in the shared formula range. - for (SCROW i = 1; i <= 9; ++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)); - } -} - -void ScOpenCLTest::testMathFormulaBitAnd() +void ScOpenCLTest1::testMathFormulaBitAnd() { initTestEnv(u"ods/opencl/math/BitAnd.ods"); ScDocument* pDoc = getScDoc(); @@ -2861,78 +2397,37 @@ void ScOpenCLTest::testMathFormulaBitAnd() } } -void ScOpenCLTest::testStatisticalFormulaPoisson() +void ScOpenCLTest1::testMathFormulaLN() { - initTestEnv(u"xls/opencl/statistical/Poisson.xls"); + initTestEnv(u"xls/opencl/math/LN.xls"); ScDocument* pDoc = getScDoc(); ScDocument* pDocRes = getScDoc2(); pDoc->CalcAll(); // Check the results of formula cells in the shared formula range. - for (SCROW i = 1; i <= 19; ++i) + for (SCROW i = 1; i <= 9; ++i) { - double fLibre = pDoc->GetValue(ScAddress(3,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(3,i,0)); + double fLibre = pDoc->GetValue(ScAddress(1,i,0)); + double fExcel = pDocRes->GetValue(ScAddress(1,i,0)); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } } -void ScOpenCLTest::testStatisticalFormulaExpondist() +void ScOpenCLTest1::testMathFormulaRound() { - initTestEnv(u"xls/opencl/statistical/Expondist.xls"); + initTestEnv(u"xls/opencl/math/ROUND.xls"); ScDocument* pDoc = getScDoc(); ScDocument* pDocRes = getScDoc2(); pDoc->CalcAll(); // Check the results of formula cells in the shared formula range. - for (SCROW i = 0; i <= 9; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(3,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(3,i,0)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); - } -} - -void ScOpenCLTest::testMathFormulaBitOr() -{ - initTestEnv(u"ods/opencl/math/BitOr.ods"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Verify BitOr Function - for (SCROW i = 1; i <= 20; ++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)); - } -} - -void ScOpenCLTest::testMathFormulaOdd() -{ - initTestEnv(u"xls/opencl/math/odd.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - for (SCROW i = 0; i <= 15; ++i) + for (SCROW i = 1; i <= 9; ++i) { double fLibre = pDoc->GetValue(ScAddress(1,i,0)); double fExcel = pDocRes->GetValue(ScAddress(1,i,0)); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } -} - -void ScOpenCLTest::testMathFormulaLN() -{ - initTestEnv(u"xls/opencl/math/LN.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Check the results of formula cells in the shared formula range. - for (SCROW i = 1; i <= 9; ++i) + for (SCROW i = 15; i <= 25; ++i) { double fLibre = pDoc->GetValue(ScAddress(1,i,0)); double fExcel = pDocRes->GetValue(ScAddress(1,i,0)); @@ -2940,1570 +2435,28 @@ void ScOpenCLTest::testMathFormulaLN() } } -void ScOpenCLTest::testMathFormulaMod() +void ScOpenCLTest1::testStatisticalFormulaGammaDist() { - initTestEnv(u"xls/opencl/math/mod.xls"); + initTestEnv(u"xls/opencl/statistical/GammaDist.xls"); ScDocument* pDoc = getScDoc(); ScDocument* pDocRes = getScDoc2(); pDoc->CalcAll(); - for (SCROW i = 0; i <= 15; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(2,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(2,i,0)); - if(fExcel == 0.0f) - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, 1e-10); - else - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); - } -} - -void ScOpenCLTest::testMathFormulaRound() -{ - initTestEnv(u"xls/opencl/math/ROUND.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Check the results of formula cells in the shared formula range. - for (SCROW i = 1; i <= 9; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(1,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(1,i,0)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); - } - for (SCROW i = 15; i <= 25; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(1,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(1,i,0)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); - } -} - -void ScOpenCLTest::testStatisticalFormulaGammaDist() -{ - initTestEnv(u"xls/opencl/statistical/GammaDist.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Check the results of formula cells in the shared formula range. - for (SCROW i = 1; i <= 19; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(4,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(4,i,0)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); - } -} - -void ScOpenCLTest::testStatisticalFormulaGammaInv() -{ - initTestEnv(u"xls/opencl/statistical/GammaInv.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Check the results of formula cells in the shared formula range. - for (SCROW i = 1; i <= 19; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(3,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(3,i,0)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); - fLibre = pDoc->GetValue(ScAddress(4,i,0)); - fExcel = pDocRes->GetValue(ScAddress(4,i,0)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); - } -} - -void ScOpenCLTest::testStatisticalFormulaFInv() -{ - initTestEnv(u"xls/opencl/statistical/FInv.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Check the results of formula cells in the shared formula range. - for (SCROW i = 1; i <= 19; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(3,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(3,i,0)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); - fLibre = pDoc->GetValue(ScAddress(4,i,0)); - fExcel = pDocRes->GetValue(ScAddress(4,i,0)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); - } -} - -void ScOpenCLTest::testStatisticalFormulaFTest() -{ - initTestEnv(u"xls/opencl/statistical/FTest.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Check the results of formula cells in the shared formula range. - for (SCROW i = 1; i <= 19; ++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)); - } -} - -void ScOpenCLTest::testStatisticalFormulaB() -{ - initTestEnv(u"xls/opencl/statistical/B.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Check the results of formula cells in the shared formula range. - for (SCROW i = 1; i <= 19; ++i) + // Check the results of formula cells in the shared formula range. + for (SCROW i = 1; i <= 19; ++i) { double fLibre = pDoc->GetValue(ScAddress(4,i,0)); double fExcel = pDocRes->GetValue(ScAddress(4,i,0)); CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); - fLibre = pDoc->GetValue(ScAddress(5,i,0)); - fExcel = pDocRes->GetValue(ScAddress(5,i,0)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); - } -} - -void ScOpenCLTest::testStatisticalFormulaBetaDist() -{ - initTestEnv(u"ods/opencl/statistical/BetaDist.ods"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Check the results of formula cells in the shared formula range. - for (SCROW i = 1; i <= 19; ++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)); - fLibre = pDoc->GetValue(ScAddress(7,i,0)); - fExcel = pDocRes->GetValue(ScAddress(7,i,0)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); - } -} - -void ScOpenCLTest::testMathFormulaEven() -{ - initTestEnv(u"xls/opencl/math/even.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - for (SCROW i = 0; i <= 15; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(1,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(1,i,0)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); - } -} - -void ScOpenCLTest::testMathFormulaExp() -{ - initTestEnv(u"ods/opencl/math/exp.ods"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - for (SCROW i = 0; i <= 15; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(1,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(1,i,0)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); - } -} - -void ScOpenCLTest::testStatisticalFormulaChiDist() -{ - initTestEnv(u"xls/opencl/statistical/ChiDist.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Check the results of formula cells in the shared formula range. - for (SCROW i = 1; i <= 19; ++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)); - } -} - -void ScOpenCLTest::testMathFormulaBitLshift() -{ - initTestEnv(u"ods/opencl/math/BitLshift.ods"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Verify BitLshift Function - for (SCROW i = 1; i <= 20; ++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)); - } -} - -void ScOpenCLTest::testMathFormulaBitRshift() -{ - initTestEnv(u"ods/opencl/math/BitRshift.ods"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Verify BitRshift Function - for (SCROW i = 1; i <= 20; ++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)); - } -} - -void ScOpenCLTest::testMathFormulaFloor() -{ - initTestEnv(u"ods/opencl/math/floor.ods"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - for (SCROW i = 0; i <= 9; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(3,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(3,i,0)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); - } -} - -void ScOpenCLTest::testMathFormulaLog() -{ - initTestEnv(u"xls/opencl/math/log.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - for (SCROW i = 0; i <= 47; ++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)); - } -} - -void ScOpenCLTest::testSpreadSheetFormulaVLookup() -{ - initTestEnv(u"xls/opencl/spreadsheet/VLookup.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Check the results of formula cells in the shared formula range. - for (SCROW i = 1; i <= 32; ++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)); - } - for (SCROW i = 40; i <= 50; ++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)); - } -} - -void ScOpenCLTest::testStatisticalFormulaChiInv() -{ - initTestEnv(u"xls/opencl/statistical/ChiInv.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Check the results of formula cells in the shared formula range. - 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)); - } -} - -void ScOpenCLTest::testMathFormulaConvert() -{ - initTestEnv(u"xls/opencl/math/convert.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - for (SCROW i = 0; i <= 3; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(1,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(1,i,0)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); - } -} - -void ScOpenCLTest::testMathCountIfsFormula() -{ - initTestEnv(u"xls/opencl/math/countifs.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - ScDocShell* pDocSh = getScDocShell(); - pDocSh->DoHardRecalc(); - - for (SCROW i = 1; i < 10; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(4, i, 0)); - double fExcel = pDocRes->GetValue(ScAddress(4, i, 0)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); - } -} - -void ScOpenCLTest::testMathFormulaBitXor() -{ - initTestEnv(u"ods/opencl/math/BitXor.ods"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Verify BitXor Function - for (SCROW i = 1; i <= 20; ++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)); - } -} - -void ScOpenCLTest::testMathAverageIfsFormula() -{ - initTestEnv(u"xls/opencl/math/averageifs.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - ScDocShell* pDocSh = getScDocShell(); - - pDocSh->DoHardRecalc(); - - for (SCROW i = 1; i <= 11; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(4,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(4,i,0)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); - } -} - -void ScOpenCLTest::testMathFormulaLog10() -{ - initTestEnv(u"ods/opencl/math/log10.ods"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - for (SCROW i = 0; i <= 15; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(1,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(1,i,0)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); - } -} - -void ScOpenCLTest::testMathFormulaCombina() -{ - initTestEnv(u"xls/opencl/math/combina.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - for (SCROW i = 0; i <= 47; ++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)); - } -} - -void ScOpenCLTest::testMathFormulaCeil() -{ - initTestEnv(u"ods/opencl/math/Ceil.ods"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Verify Ceiling Function - for (SCROW i = 1; i <= 20; ++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)); - } -} - -void ScOpenCLTest::testMathFormulaSqrtPi() -{ - initTestEnv(u"xls/opencl/math/sqrtpi.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - for (SCROW i = 0; i < 20; ++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)); - } -} - -void ScOpenCLTest::testStatisticalFormulaVarP() -{ - initTestEnv(u"xls/opencl/statistical/VarP.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Check the results of formula cells in the shared formula range. - for (SCROW i = 1; i <= 20; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(1,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(1,i,0)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); - } -} - -void ScOpenCLTest::testStatisticalFormulaStDev() -{ - initTestEnv(u"xls/opencl/statistical/StDev.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Check the results of formula cells in the shared formula range. - for (SCROW i = 1; i <= 20; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(1,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(1,i,0)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); - } -} - -void ScOpenCLTest::testStatisticalFormulaStDevP() -{ - initTestEnv(u"xls/opencl/statistical/StDevP.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Check the results of formula cells in the shared formula range. - for (SCROW i = 1; i <= 20; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(1,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(1,i,0)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); - } -} - -void ScOpenCLTest::testStatisticalFormulaSlope() -{ - initTestEnv(u"xls/opencl/statistical/Slope.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Check the results of formula cells in the shared formula range. - for (SCROW i = 1; i <= 20; ++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)); - } -} - -void ScOpenCLTest::testStatisticalFormulaSTEYX() -{ - initTestEnv(u"xls/opencl/statistical/STEYX.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Check the results of formula cells in the shared formula range. - for (SCROW i = 1; i <= 20; ++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)); - } -} - -void ScOpenCLTest::testStatisticalFormulaZTest() -{ - initTestEnv(u"xls/opencl/statistical/ZTest.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Check the results of formula cells in the shared formula range. - for (SCROW i = 1; i <= 20; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(3,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(3,i,0)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); - } -} - -void ScOpenCLTest::testStatisticalFormulaTTest() -{ - initTestEnv(u"xls/opencl/statistical/TTest.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Check the results of formula cells in the shared formula range. - for (SCROW i = 1; i <= 20; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(4,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(4,i,0)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); - } -} - -void ScOpenCLTest::testStatisticalFormulaTDist() -{ - initTestEnv(u"xls/opencl/statistical/TDist.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Check the results of formula cells in the shared formula range. - for (SCROW i = 1; i <= 20; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(3,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(3,i,0)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); - } -} - -void ScOpenCLTest::testStatisticalFormulaTInv() -{ - initTestEnv(u"xls/opencl/statistical/TInv.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Check the results of formula cells in the shared formula range. - for (SCROW i = 1; i <= 20; ++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)); - } -} - -void ScOpenCLTest::testStatisticalFormulaBinomDist() -{ - initTestEnv(u"xls/opencl/statistical/BinomDist.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Check the results of formula cells in the shared formula range. - for (SCROW i = 1; i <= 9; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(4,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(4,i,0)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); - } -} - -void ScOpenCLTest::testMathFormulaProduct() -{ - initTestEnv(u"xls/opencl/math/product.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - for (SCROW i = 0; i <= 3; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(1,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(1,i,0)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); - } -} - -#if 0 //Disabled temporarily -void ScOpenCLTest::testMathFormulaKombin() -{ - initTestEnv(u"ods/opencl/math/Kombin.ods"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Verify Combin Function - for (SCROW i = 1; i <= 20; ++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)); - } -} -#endif - -void ScOpenCLTest:: testArrayFormulaSumX2MY2() -{ - initTestEnv(u"xls/opencl/array/SUMX2MY2.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - for (SCROW i = 0; i <= 9; ++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)); - } - for (SCROW i = 20; i <= 26; ++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)); - } -} - -void ScOpenCLTest::testStatisticalFormulaHypGeomDist() -{ - initTestEnv(u"xls/opencl/statistical/HypGeomDist.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Check the results of formula cells in the shared formula range. - for (SCROW i = 1; i <= 19; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(4,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(4,i,0)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); - } -} - -void ScOpenCLTest:: testArrayFormulaSumX2PY2() -{ - initTestEnv(u"xls/opencl/array/SUMX2PY2.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - for (SCROW i = 0; i <= 9; ++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)); - } - for (SCROW i = 20; i <= 26; ++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)); - } -} - -void ScOpenCLTest::testStatisticalFormulaBetainv() -{ - initTestEnv(u"xls/opencl/statistical/Betainv.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Check the results of formula cells in the shared formula range. - for (SCROW i = 1; i <= 19; ++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)); - } -} - -void ScOpenCLTest::testStatisticalFormulaMina() -{ - initTestEnv(u"xls/opencl/statistical/Mina.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - for (SCROW i = 0; i <= 9; ++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)); - } -} - -void ScOpenCLTest:: testArrayFormulaSumXMY2() -{ - initTestEnv(u"xls/opencl/array/SUMXMY2.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - for (SCROW i = 0; i <= 9; ++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)); - } - for (SCROW i = 20; i <= 26; ++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)); - } -} - -void ScOpenCLTest::testStatisticalFormulaCountA() -{ - initTestEnv(u"xls/opencl/statistical/counta.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - for (SCROW i = 0; i <= 9; ++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)); - } -} - -void ScOpenCLTest::testStatisticalFormulaMaxa() -{ - initTestEnv(u"xls/opencl/statistical/Maxa.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - for (SCROW i = 0; i <= 9; ++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)); - } -} - -void ScOpenCLTest::testMathFormulaSumProduct() -{ - initTestEnv(u"xls/opencl/math/sumproduct_mixSliding.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Check the results of formula cells in the shared formula range. - for (SCROW i = 0; i <= 9; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(2,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(2,i,0)); - if ( i == 1 ) - CPPUNIT_ASSERT_DOUBLES_EQUAL(82, fLibre, fabs(0.0001*fExcel)); - else if ( i == 2 ) - CPPUNIT_ASSERT_DOUBLES_EQUAL(113, fLibre, fabs(0.0001*fExcel)); - else if ( i == 4 ) - CPPUNIT_ASSERT_DOUBLES_EQUAL(175, fLibre, fabs(0.0001*fExcel)); - else if ( i == 5 ) - CPPUNIT_ASSERT_DOUBLES_EQUAL(206, fLibre, fabs(0.0001*fExcel)); - else if ( i == 6 ) - CPPUNIT_ASSERT_DOUBLES_EQUAL(237, fLibre, fabs(0.0001*fExcel)); - else if ( i == 7 ) - CPPUNIT_ASSERT_DOUBLES_EQUAL(268, fLibre, fabs(0.0001*fExcel)); - else - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); - } -} - -void ScOpenCLTest::testMathFormulaAverageIf() -{ - initTestEnv(u"xls/opencl/math/averageif.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - for (SCROW i = 2; i <= 21; ++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)); - } -} - -void ScOpenCLTest::testStatisticalFormulaAverageA() -{ - initTestEnv(u"xls/opencl/statistical/AverageA.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - for (SCROW i = 0; i <= 9; ++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)); - } -} - -void ScOpenCLTest:: testLogicalFormulaAnd() -{ - initTestEnv(u"xls/opencl/logical/and.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - for (SCROW i = 1; i <= 20; ++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)); - } - for (SCROW i = 1; i <= 20; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(3, i, 0)); - double fExcel = pDocRes->GetValue(ScAddress(3, i, 0)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); - } -} - -void ScOpenCLTest::testStatisticalFormulaVarA() -{ - initTestEnv(u"xls/opencl/statistical/VarA.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Check the results of formula cells in the shared formula range. - for (SCROW i = 1; i <= 20; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(1,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(1,i,0)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); - } -} - -void ScOpenCLTest::testStatisticalFormulaVarPA() -{ - initTestEnv(u"xls/opencl/statistical/VarPA.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - // Check the results of formula cells in the shared formula range. - for (SCROW i = 1; i <= 20; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(1,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(1,i,0)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); - } -} - -void ScOpenCLTest::testStatisticalFormulaStDevA() -{ - initTestEnv(u"xls/opencl/statistical/StDevA.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Check the results of formula cells in the shared formula range. - for (SCROW i = 1; i <= 20; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(1,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(1,i,0)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); - } -} - -void ScOpenCLTest::testStatisticalFormulaStDevPA() -{ - initTestEnv(u"xls/opencl/statistical/StDevPA.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Check the results of formula cells in the shared formula range. - for (SCROW i = 1; i <= 20; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(1,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(1,i,0)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); - } -} - -void ScOpenCLTest:: testFinancialMDurationFormula1() -{ - initTestEnv(u"xls/opencl/financial/MDuration1.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - for (SCROW i = 0; i <= 9; ++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.00000000001*fExcel)); - } -} - -void ScOpenCLTest::testMathFormulaSumProduct2() -{ - initTestEnv(u"xls/opencl/math/sumproductTest.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Check the results of formula cells in the shared formula range. - for (SCROW i = 2; i <= 12; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(4,i,1)); - double fExcel = pDocRes->GetValue(ScAddress(4,i,1)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); - } -} - -void ScOpenCLTest:: testStatisticalParallelCountBug() -{ - initTestEnv(u"ods/opencl/statistical/parallel_count_bug_243.ods"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - for (SCROW i = 0; i < 13; ++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)); - } -} - -void ScOpenCLTest:: testLogicalFormulaOr() -{ - initTestEnv(u"xls/opencl/logical/or.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - for (SCROW i = 0; i < 20; ++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)); - } -} - -void ScOpenCLTest:: testLogicalFormulaNot() -{ - initTestEnv(u"xls/opencl/logical/not.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - for (SCROW i = 0; i < 3000; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(1, i, 0)); - double fExcel = pDocRes->GetValue(ScAddress(1, i, 0)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); - } -} - -void ScOpenCLTest:: testLogicalFormulaXor() -{ - initTestEnv(u"xls/opencl/logical/xor.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - for (SCROW i = 0; i < 3000; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(1, i, 0)); - double fExcel = pDocRes->GetValue(ScAddress(1, i, 0)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); - } -} - -void ScOpenCLTest::testDatabaseFormulaDcount() -{ - initTestEnv(u"xls/opencl/database/dcount.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Check the results of formula cells in the shared formula range. - for (SCROW i = 1; i <= 32; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(9,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(10,i,0)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.00000000001)); - } -} - -void ScOpenCLTest::testDatabaseFormulaDcountA() -{ - initTestEnv(u"xls/opencl/database/dcountA.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Check the results of formula cells in the shared formula range. - for (SCROW i = 1; i <= 32; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(9,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(10,i,0)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.00000000001)); - } -} - -void ScOpenCLTest::testDatabaseFormulaDmax() -{ - initTestEnv(u"xls/opencl/database/dmax.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Check the results of formula cells in the shared formula range. - for (SCROW i = 1; i <= 32; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(9,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(10,i,0)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.00000000001)); - } -} - -void ScOpenCLTest::testDatabaseFormulaDmin() -{ - initTestEnv(u"xls/opencl/database/dmin.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Check the results of formula cells in the shared formula range. - for (SCROW i = 1; i <= 32; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(9,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(10,i,0)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.00000000001)); - } -} - -void ScOpenCLTest::testDatabaseFormulaDproduct() -{ - initTestEnv(u"xls/opencl/database/dproduct.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Check the results of formula cells in the shared formula range. - for (SCROW i = 1; i <= 32; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(9,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(10,i,0)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.00000000001)); - } -} - -void ScOpenCLTest::testDatabaseFormulaDaverage() -{ - initTestEnv(u"xls/opencl/database/daverage.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Check the results of formula cells in the shared formula range. - for (SCROW i = 1; i <= 32; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(9,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(10,i,0)); - //CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.00000000001)); - } -} - -void ScOpenCLTest::testDatabaseFormulaDstdev() -{ - initTestEnv(u"xls/opencl/database/dstdev.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Check the results of formula cells in the shared formula range. - for (SCROW i = 1; i <= 32; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(9,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(10,i,0)); - //CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.00000000001)); - } -} - -void ScOpenCLTest::testDatabaseFormulaDstdevp() -{ - initTestEnv(u"xls/opencl/database/dstdevp.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Check the results of formula cells in the shared formula range. - for (SCROW i = 1; i <= 32; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(9,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(10,i,0)); - //CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.00000000001)); - } -} - -void ScOpenCLTest::testDatabaseFormulaDsum() -{ - initTestEnv(u"xls/opencl/database/dsum.xls"); - ScDocument* pDoc = getScDoc(); - ScDocument* pDocRes = getScDoc2(); - pDoc->CalcAll(); - - // Check the results of formula cells in the shared formula range. - for (SCROW i = 1; i <= 32; ++i) - { - double fLibre = pDoc->GetValue(ScAddress(9,i,0)); - double fExcel = pDocRes->GetValue(ScAddress(10,i,0)); ... etc. - the rest is truncated