summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2023-01-27 13:19:25 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2023-01-27 15:37:14 +0000
commitfae7cb51c9f61fd190a9d6f1147d3bc1a4a0c1cf (patch)
tree08ea263481dd7a474182aed3fbe881c3426bc735 /sc
parent3d98527de0f3a39cd5b7b068f5d603e51efa2221 (diff)
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 <sbergman@redhat.com> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146255
Diffstat (limited to 'sc')
-rw-r--r--sc/CppunitTest_sc_opencl-1.mk (renamed from sc/CppunitTest_sc_opencl_test.mk)24
-rw-r--r--sc/CppunitTest_sc_opencl-2.mk80
-rw-r--r--sc/Module_sc.mk3
-rw-r--r--sc/qa/unit/opencl-test-1.cxx (renamed from sc/qa/unit/opencl-test.cxx)2297
-rw-r--r--sc/qa/unit/opencl-test-2.cxx2153
5 files changed, 2372 insertions, 2185 deletions
diff --git a/sc/CppunitTest_sc_opencl_test.mk b/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 c829ee0ae3ca..452a5993b64d 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
index d01baf7cac36..e079f7b338ef 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test-1.cxx
@@ -16,11 +16,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
@@ -149,120 +149,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);
@@ -379,119 +267,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:
@@ -500,7 +275,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
@@ -535,24 +310,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 = dynamic_cast<ScModelObj*>(mxComponent2.get());
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();
@@ -574,7 +349,7 @@ void ScOpenCLTest::testCompilerHorizontal()
}
}
-void ScOpenCLTest::testCompilerNested()
+void ScOpenCLTest1::testCompilerNested()
{
initTestEnv(u"ods/opencl/compiler/nested.ods");
ScDocument* pDoc = getScDoc();
@@ -590,7 +365,7 @@ void ScOpenCLTest::testCompilerNested()
}
}
-void ScOpenCLTest::testCompilerString()
+void ScOpenCLTest1::testCompilerString()
{
initTestEnv(u"ods/opencl/compiler/string.ods");
ScDocument* pDoc = getScDoc();
@@ -610,7 +385,7 @@ void ScOpenCLTest::testCompilerString()
}
}
-void ScOpenCLTest::testCompilerInEq()
+void ScOpenCLTest1::testCompilerInEq()
{
initTestEnv(u"ods/opencl/compiler/ineq.ods");
ScDocument* pDoc = getScDoc();
@@ -626,7 +401,7 @@ void ScOpenCLTest::testCompilerInEq()
}
}
-void ScOpenCLTest::testCompilerPrecision()
+void ScOpenCLTest1::testCompilerPrecision()
{
initTestEnv(u"ods/opencl/compiler/precision.ods");
ScDocument* pDoc = getScDoc();
@@ -647,7 +422,7 @@ void ScOpenCLTest::testCompilerPrecision()
}
#if 0
-void ScOpenCLTest::testSharedFormulaXLSStockHistory()
+void ScOpenCLTest1::testSharedFormulaXLSStockHistory()
{
initTestEnv(u"xls/stock-history.xls");
ScDocument* pDoc = getScDoc();
@@ -671,7 +446,7 @@ void ScOpenCLTest::testSharedFormulaXLSStockHistory()
}
}
-void ScOpenCLTest::testSharedFormulaXLSGroundWater()
+void ScOpenCLTest1::testSharedFormulaXLSGroundWater()
{
initTestEnv(u"xls/ground-water-daily.xls");
ScDocument* pDoc = getScDoc();
@@ -691,7 +466,7 @@ void ScOpenCLTest::testSharedFormulaXLSGroundWater()
}
#endif
-void ScOpenCLTest::testSystematic()
+void ScOpenCLTest1::testSystematic()
{
initTestEnv(u"xls/systematic.xls");
@@ -782,7 +557,7 @@ void ScOpenCLTest::testSystematic()
}
-void ScOpenCLTest::testSharedFormulaXLS()
+void ScOpenCLTest1::testSharedFormulaXLS()
{
initTestEnv(u"xls/sum_ex.xls");
ScDocument* pDoc = getScDoc();
@@ -870,7 +645,7 @@ void ScOpenCLTest::testSharedFormulaXLS()
}
}
-void ScOpenCLTest::testMathFormulaCos()
+void ScOpenCLTest1::testMathFormulaCos()
{
initTestEnv(u"xls/opencl/math/cos.xls");
ScDocument* pDoc = getScDoc();
@@ -885,7 +660,7 @@ void ScOpenCLTest::testMathFormulaCos()
}
}
-void ScOpenCLTest::testMathFormulaSinh()
+void ScOpenCLTest1::testMathFormulaSinh()
{
initTestEnv(u"xls/opencl/math/sinh.xls");
ScDocument* pDoc = getScDoc();
@@ -901,37 +676,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();
@@ -1080,7 +825,7 @@ void ScOpenCLTest::testFinacialFormula()
}
}
-void ScOpenCLTest::testStatisticalFormulaCorrel()
+void ScOpenCLTest1::testStatisticalFormulaCorrel()
{
initTestEnv(u"ods/opencl/statistical/Correl.ods");
ScDocument* pDoc = getScDoc();
@@ -1095,7 +840,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();
@@ -1111,7 +856,7 @@ void ScOpenCLTest::testStatisticalFormulaFisher()
}
}
-void ScOpenCLTest::testStatisticalFormulaFisherInv()
+void ScOpenCLTest1::testStatisticalFormulaFisherInv()
{
initTestEnv(u"xls/opencl/statistical/FisherInv.xls");
ScDocument* pDoc = getScDoc();
@@ -1127,7 +872,7 @@ void ScOpenCLTest::testStatisticalFormulaFisherInv()
}
}
-void ScOpenCLTest::testStatisticalFormulaGamma()
+void ScOpenCLTest1::testStatisticalFormulaGamma()
{
initTestEnv(u"xls/opencl/statistical/Gamma.xls");
ScDocument* pDoc = getScDoc();
@@ -1143,7 +888,7 @@ void ScOpenCLTest::testStatisticalFormulaGamma()
}
}
-void ScOpenCLTest::testFinacialFvscheduleFormula()
+void ScOpenCLTest1::testFinacialFvscheduleFormula()
{
initTestEnv(u"xls/opencl/financial/Fvschedule.xls");
ScDocument* pDoc = getScDoc();
@@ -1158,7 +903,7 @@ void ScOpenCLTest::testFinacialFvscheduleFormula()
}
}
-void ScOpenCLTest::testMathFormulaAbs()
+void ScOpenCLTest1::testMathFormulaAbs()
{
initTestEnv(u"ods/opencl/math/Abs.ods");
ScDocument* pDoc = getScDoc();
@@ -1174,7 +919,7 @@ void ScOpenCLTest::testMathFormulaAbs()
}
}
-void ScOpenCLTest::testFinacialSYDFormula()
+void ScOpenCLTest1::testFinacialSYDFormula()
{
initTestEnv(u"xls/opencl/financial/SYD.xls");
ScDocument* pDoc = getScDoc();
@@ -1191,7 +936,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();
@@ -1207,7 +952,7 @@ void ScOpenCLTest::testFinacialIRRFormula()
}
#endif
-void ScOpenCLTest::testStatisticalFormulaGammaLn()
+void ScOpenCLTest1::testStatisticalFormulaGammaLn()
{
initTestEnv(u"xls/opencl/statistical/GammaLn.xls");
ScDocument* pDoc = getScDoc();
@@ -1223,7 +968,7 @@ void ScOpenCLTest::testStatisticalFormulaGammaLn()
}
}
-void ScOpenCLTest::testStatisticalFormulaGauss()
+void ScOpenCLTest1::testStatisticalFormulaGauss()
{
initTestEnv(u"xls/opencl/statistical/Gauss.xls");
ScDocument* pDoc = getScDoc();
@@ -1239,7 +984,7 @@ void ScOpenCLTest::testStatisticalFormulaGauss()
}
}
-void ScOpenCLTest::testStatisticalFormulaGeoMean()
+void ScOpenCLTest1::testStatisticalFormulaGeoMean()
{
initTestEnv(u"xls/opencl/statistical/GeoMean.xls");
ScDocument* pDoc = getScDoc();
@@ -1255,7 +1000,7 @@ void ScOpenCLTest::testStatisticalFormulaGeoMean()
}
}
-void ScOpenCLTest::testStatisticalFormulaHarMean()
+void ScOpenCLTest1::testStatisticalFormulaHarMean()
{
initTestEnv(u"xls/opencl/statistical/HarMean.xls");
ScDocument* pDoc = getScDoc();
@@ -1271,7 +1016,7 @@ void ScOpenCLTest::testStatisticalFormulaHarMean()
}
}
-void ScOpenCLTest::testFinacialSLNFormula()
+void ScOpenCLTest1::testFinacialSLNFormula()
{
initTestEnv(u"xls/opencl/financial/SLN.xls");
ScDocument* pDoc = getScDoc();
@@ -1286,7 +1031,7 @@ void ScOpenCLTest::testFinacialSLNFormula()
}
}
-void ScOpenCLTest::testFinacialMIRRFormula()
+void ScOpenCLTest1::testFinacialMIRRFormula()
{
initTestEnv(u"xls/opencl/financial/MIRR.xls");
ScDocument* pDoc = getScDoc();
@@ -1301,7 +1046,7 @@ void ScOpenCLTest::testFinacialMIRRFormula()
}
}
-void ScOpenCLTest::testFinancialCoupdaybsFormula()
+void ScOpenCLTest1::testFinancialCoupdaybsFormula()
{
initTestEnv(u"xls/opencl/financial/Coupdaybs.xls");
ScDocument* pDoc = getScDoc();
@@ -1316,7 +1061,7 @@ void ScOpenCLTest::testFinancialCoupdaybsFormula()
}
}
-void ScOpenCLTest::testFinacialDollardeFormula()
+void ScOpenCLTest1::testFinacialDollardeFormula()
{
initTestEnv(u"xls/opencl/financial/Dollarde.xls");
ScDocument* pDoc = getScDoc();
@@ -1331,7 +1076,7 @@ void ScOpenCLTest::testFinacialDollardeFormula()
}
}
-void ScOpenCLTest::testFinancialCoupdaysFormula()
+void ScOpenCLTest1::testFinancialCoupdaysFormula()
{
initTestEnv(u"xls/opencl/financial/Coupdays.xls");
ScDocument* pDoc = getScDoc();
@@ -1347,7 +1092,7 @@ void ScOpenCLTest::testFinancialCoupdaysFormula()
}
-void ScOpenCLTest::testFinancialCoupdaysncFormula()
+void ScOpenCLTest1::testFinancialCoupdaysncFormula()
{
initTestEnv(u"xls/opencl/financial/Coupdaysnc.xls");
ScDocument* pDoc = getScDoc();
@@ -1361,7 +1106,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();
@@ -1376,7 +1121,7 @@ void ScOpenCLTest::testFinacialRateFormula()
}
}
-void ScOpenCLTest::testFinancialAccrintmFormula()
+void ScOpenCLTest1::testFinancialAccrintmFormula()
{
initTestEnv(u"xls/opencl/financial/Accrintm.xls");
ScDocument* pDoc = getScDoc();
@@ -1391,7 +1136,7 @@ void ScOpenCLTest::testFinancialAccrintmFormula()
}
}
-void ScOpenCLTest::testFinancialCoupnumFormula()
+void ScOpenCLTest1::testFinancialCoupnumFormula()
{
initTestEnv(u"xls/opencl/financial/Coupnum.xls");
ScDocument* pDoc = getScDoc();
@@ -1406,7 +1151,7 @@ void ScOpenCLTest::testFinancialCoupnumFormula()
}
}
-void ScOpenCLTest::testStatisticalFormulaNegbinomdist()
+void ScOpenCLTest1::testStatisticalFormulaNegbinomdist()
{
initTestEnv(u"xls/opencl/statistical/Negbinomdist.xls");
ScDocument* pDoc = getScDoc();
@@ -1422,7 +1167,7 @@ void ScOpenCLTest::testStatisticalFormulaNegbinomdist()
}
}
-void ScOpenCLTest::testMathFormulaSin()
+void ScOpenCLTest1::testMathFormulaSin()
{
initTestEnv(u"xls/opencl/math/sin.xls");
ScDocument* pDoc = getScDoc();
@@ -1437,22 +1182,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();
@@ -1467,7 +1197,7 @@ void ScOpenCLTest::testMathFormulaTan()
}
}
-void ScOpenCLTest::testMathFormulaTanH()
+void ScOpenCLTest1::testMathFormulaTanH()
{
initTestEnv(u"xls/opencl/math/tanh.xls");
ScDocument* pDoc = getScDoc();
@@ -1482,7 +1212,7 @@ void ScOpenCLTest::testMathFormulaTanH()
}
}
-void ScOpenCLTest::testMathFormulaSqrt()
+void ScOpenCLTest1::testMathFormulaSqrt()
{
initTestEnv(u"xls/opencl/math/sqrt.xls");
ScDocument* pDoc = getScDoc();
@@ -1497,7 +1227,7 @@ void ScOpenCLTest::testMathFormulaSqrt()
}
}
-void ScOpenCLTest::testFinacialPriceFormula()
+void ScOpenCLTest1::testFinacialPriceFormula()
{
initTestEnv(u"xls/opencl/financial/Price.xls");
ScDocument* pDoc = getScDoc();
@@ -1512,7 +1242,7 @@ void ScOpenCLTest::testFinacialPriceFormula()
}
}
-void ScOpenCLTest::testFinacialDollarfrFormula()
+void ScOpenCLTest1::testFinacialDollarfrFormula()
{
initTestEnv(u"xls/opencl/financial/Dollarfr.xls");
ScDocument* pDoc = getScDoc();
@@ -1527,7 +1257,7 @@ void ScOpenCLTest::testFinacialDollarfrFormula()
}
}
-void ScOpenCLTest::testFinacialPriceDiscFormula()
+void ScOpenCLTest1::testFinacialPriceDiscFormula()
{
initTestEnv(u"xls/opencl/financial/PriceDisc.xls");
ScDocument* pDoc = getScDoc();
@@ -1542,7 +1272,7 @@ void ScOpenCLTest::testFinacialPriceDiscFormula()
}
}
-void ScOpenCLTest::testFinacialODDLPRICEFormula()
+void ScOpenCLTest1::testFinacialODDLPRICEFormula()
{
initTestEnv(u"xls/opencl/financial/Oddlprice.xls");
ScDocument* pDoc = getScDoc();
@@ -1557,7 +1287,7 @@ void ScOpenCLTest::testFinacialODDLPRICEFormula()
}
}
-void ScOpenCLTest:: testFinacialOddlyieldFormula()
+void ScOpenCLTest1:: testFinacialOddlyieldFormula()
{
initTestEnv(u"xls/opencl/financial/Oddlyield.xls");
ScDocument* pDoc = getScDoc();
@@ -1572,7 +1302,7 @@ void ScOpenCLTest:: testFinacialOddlyieldFormula()
}
}
-void ScOpenCLTest::testFinacialDISCFormula()
+void ScOpenCLTest1::testFinacialDISCFormula()
{
initTestEnv(u"xls/opencl/financial/DISC.xls");
ScDocument* pDoc = getScDoc();
@@ -1587,7 +1317,7 @@ void ScOpenCLTest::testFinacialDISCFormula()
}
}
-void ScOpenCLTest:: testFinacialPVFormula()
+void ScOpenCLTest1:: testFinacialPVFormula()
{
initTestEnv(u"xls/opencl/financial/PV.xls");
ScDocument* pDoc = getScDoc();
@@ -1602,7 +1332,7 @@ void ScOpenCLTest:: testFinacialPVFormula()
}
}
-void ScOpenCLTest::testFinacialINTRATEFormula()
+void ScOpenCLTest1::testFinacialINTRATEFormula()
{
initTestEnv(u"xls/opencl/financial/INTRATE.xls");
ScDocument* pDoc = getScDoc();
@@ -1617,7 +1347,7 @@ void ScOpenCLTest::testFinacialINTRATEFormula()
}
}
-void ScOpenCLTest::testStatisticalFormulaStandard()
+void ScOpenCLTest1::testStatisticalFormulaStandard()
{
initTestEnv(u"xls/opencl/statistical/Standard.xls");
ScDocument* pDoc = getScDoc();
@@ -1633,7 +1363,7 @@ void ScOpenCLTest::testStatisticalFormulaStandard()
}
}
-void ScOpenCLTest::testStatisticalFormulaWeibull()
+void ScOpenCLTest1::testStatisticalFormulaWeibull()
{
initTestEnv(u"xls/opencl/statistical/Weibull.xls");
ScDocument* pDoc = getScDoc();
@@ -1650,55 +1380,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();
@@ -1714,7 +1396,7 @@ void ScOpenCLTest::testStatisticalFormulaPearson()
}
}
-void ScOpenCLTest::testStatisticalFormulaRsq()
+void ScOpenCLTest1::testStatisticalFormulaRsq()
{
initTestEnv(u"xls/opencl/statistical/Rsq.xls");
ScDocument* pDoc = getScDoc();
@@ -1730,22 +1412,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();
@@ -1759,23 +1426,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();
@@ -1791,7 +1443,7 @@ void ScOpenCLTest::testStatisticalFormulaKurt()
}
}
-void ScOpenCLTest::testMathFormulaCot()
+void ScOpenCLTest1::testMathFormulaCot()
{
initTestEnv(u"ods/opencl/math/cot.ods");
ScDocument* pDoc = getScDoc();
@@ -1806,23 +1458,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();
@@ -1837,7 +1473,7 @@ void ScOpenCLTest::testMathFormulaCsc()
}
}
-void ScOpenCLTest::testMathFormulaCoth()
+void ScOpenCLTest1::testMathFormulaCoth()
{
initTestEnv(u"ods/opencl/math/coth.ods");
ScDocument* pDoc = getScDoc();
@@ -1852,7 +1488,7 @@ void ScOpenCLTest::testMathFormulaCoth()
}
}
-void ScOpenCLTest::testFinacialXNPVFormula()
+void ScOpenCLTest1::testFinacialXNPVFormula()
{
initTestEnv(u"xls/opencl/financial/XNPV.xls");
ScDocument* pDoc = getScDoc();
@@ -1874,7 +1510,7 @@ void ScOpenCLTest::testFinacialXNPVFormula()
}
}
-void ScOpenCLTest::testStatisticalFormulaIntercept()
+void ScOpenCLTest1::testStatisticalFormulaIntercept()
{
initTestEnv(u"xls/opencl/statistical/Intercept.xls");
ScDocument* pDoc = getScDoc();
@@ -1889,7 +1525,7 @@ void ScOpenCLTest::testStatisticalFormulaIntercept()
}
}
-void ScOpenCLTest::testFinancialAmordegrcFormula()
+void ScOpenCLTest1::testFinancialAmordegrcFormula()
{
initTestEnv(u"xls/opencl/financial/Amordegrc.xls");
ScDocument* pDoc = getScDoc();
@@ -1904,7 +1540,7 @@ void ScOpenCLTest::testFinancialAmordegrcFormula()
}
}
-void ScOpenCLTest:: testFinancialISPMTFormula()
+void ScOpenCLTest1:: testFinancialISPMTFormula()
{
initTestEnv(u"xls/opencl/financial/ISPMT.xls");
ScDocument* pDoc = getScDoc();
@@ -1919,7 +1555,7 @@ void ScOpenCLTest:: testFinancialISPMTFormula()
}
}
-void ScOpenCLTest::testStatisticalFormulaMedian()
+void ScOpenCLTest1::testStatisticalFormulaMedian()
{
initTestEnv(u"xls/opencl/statistical/Median.xls");
ScDocument* pDoc = getScDoc();
@@ -1935,7 +1571,7 @@ void ScOpenCLTest::testStatisticalFormulaMedian()
}
}
-void ScOpenCLTest::testStatisticalFormulaNormdist()
+void ScOpenCLTest1::testStatisticalFormulaNormdist()
{
initTestEnv(u"xls/opencl/statistical/Normdist.xls");
ScDocument* pDoc = getScDoc();
@@ -1951,7 +1587,7 @@ void ScOpenCLTest::testStatisticalFormulaNormdist()
}
}
-void ScOpenCLTest::testStatisticalFormulaNormsdist()
+void ScOpenCLTest1::testStatisticalFormulaNormsdist()
{
initTestEnv(u"xls/opencl/statistical/Normsdist.xls");
ScDocument* pDoc = getScDoc();
@@ -1967,7 +1603,7 @@ void ScOpenCLTest::testStatisticalFormulaNormsdist()
}
}
-void ScOpenCLTest::testStatisticalFormulaPermut()
+void ScOpenCLTest1::testStatisticalFormulaPermut()
{
initTestEnv(u"xls/opencl/statistical/Permut.xls");
ScDocument* pDoc = getScDoc();
@@ -1983,7 +1619,7 @@ void ScOpenCLTest::testStatisticalFormulaPermut()
}
}
-void ScOpenCLTest::testStatisticalFormulaPermutation()
+void ScOpenCLTest1::testStatisticalFormulaPermutation()
{
initTestEnv(u"xls/opencl/statistical/Permutation.xls");
ScDocument* pDoc = getScDoc();
@@ -1999,7 +1635,7 @@ void ScOpenCLTest::testStatisticalFormulaPermutation()
}
}
-void ScOpenCLTest::testStatisticalFormulaPhi()
+void ScOpenCLTest1::testStatisticalFormulaPhi()
{
initTestEnv(u"xls/opencl/statistical/Phi.xls");
ScDocument* pDoc = getScDoc();
@@ -2015,22 +1651,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();
@@ -2046,7 +1667,7 @@ void ScOpenCLTest::testStatisticalFormulaLogInv()
}
}
-void ScOpenCLTest::testFinacialNPERFormula()
+void ScOpenCLTest1::testFinacialNPERFormula()
{
initTestEnv(u"xls/opencl/financial/NPER.xls");
ScDocument* pDoc = getScDoc();
@@ -2061,7 +1682,7 @@ void ScOpenCLTest::testFinacialNPERFormula()
}
}
-void ScOpenCLTest::testStatisticalFormulaForecast()
+void ScOpenCLTest1::testStatisticalFormulaForecast()
{
initTestEnv(u"xls/opencl/statistical/Forecast.xls");
ScDocument* pDoc = getScDoc();
@@ -2077,7 +1698,7 @@ void ScOpenCLTest::testStatisticalFormulaForecast()
}
}
-void ScOpenCLTest::testFinancialAmorlincFormula()
+void ScOpenCLTest1::testFinancialAmorlincFormula()
{
initTestEnv(u"xls/opencl/financial/Amorlinc.xls");
ScDocument* pDoc = getScDoc();
@@ -2092,7 +1713,7 @@ void ScOpenCLTest::testFinancialAmorlincFormula()
}
}
-void ScOpenCLTest::testFinancialDDBFormula()
+void ScOpenCLTest1::testFinancialDDBFormula()
{
initTestEnv(u"xls/opencl/financial/ddb.xls");
ScDocument* pDoc = getScDoc();
@@ -2106,7 +1727,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();
@@ -2120,7 +1741,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();
@@ -2135,7 +1756,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();
@@ -2150,7 +1771,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();
@@ -2165,7 +1786,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();
@@ -2179,7 +1800,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();
@@ -2193,7 +1814,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();
@@ -2209,7 +1830,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();
@@ -2223,7 +1844,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();
@@ -2237,7 +1858,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();
@@ -2251,7 +1872,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();
@@ -2266,7 +1887,7 @@ void ScOpenCLTest::testFinacialYIELDFormula()
}
}
-void ScOpenCLTest::testFinacialYIELDDISCFormula()
+void ScOpenCLTest1::testFinacialYIELDDISCFormula()
{
initTestEnv(u"xls/opencl/financial/YIELDDISC.xls");
ScDocument* pDoc = getScDoc();
@@ -2281,7 +1902,7 @@ void ScOpenCLTest::testFinacialYIELDDISCFormula()
}
}
-void ScOpenCLTest::testFinacialYIELDMATFormula()
+void ScOpenCLTest1::testFinacialYIELDMATFormula()
{
initTestEnv(u"xls/opencl/financial/YIELDMAT.xls");
ScDocument* pDoc = getScDoc();
@@ -2295,7 +1916,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();
@@ -2310,7 +1931,7 @@ void ScOpenCLTest:: testFinacialPMTFormula()
}
}
-void ScOpenCLTest:: testFinancialDurationFormula()
+void ScOpenCLTest1:: testFinancialDurationFormula()
{
initTestEnv(u"ods/opencl/financial/Duration.ods");
ScDocument* pDoc = getScDoc();
@@ -2325,7 +1946,7 @@ void ScOpenCLTest:: testFinancialDurationFormula()
}
}
-void ScOpenCLTest::testStatisticalFormulaLogNormDist()
+void ScOpenCLTest1::testStatisticalFormulaLogNormDist()
{
initTestEnv(u"ods/opencl/statistical/LogNormDist.ods");
ScDocument* pDoc = getScDoc();
@@ -2341,7 +1962,7 @@ void ScOpenCLTest::testStatisticalFormulaLogNormDist()
}
}
-void ScOpenCLTest::testMathFormulaArcCos()
+void ScOpenCLTest1::testMathFormulaArcCos()
{
initTestEnv(u"ods/opencl/math/ArcCos.ods");
ScDocument* pDoc = getScDoc();
@@ -2357,22 +1978,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();
@@ -2387,7 +1993,7 @@ void ScOpenCLTest:: testFinacialPPMTFormula()
}
}
-void ScOpenCLTest:: testFinacialNPVFormula()
+void ScOpenCLTest1:: testFinacialNPVFormula()
{
initTestEnv(u"xls/opencl/financial/NPV.xls");
ScDocument* pDoc = getScDoc();
@@ -2402,7 +2008,7 @@ void ScOpenCLTest:: testFinacialNPVFormula()
}
}
-void ScOpenCLTest:: testFinancialDuration_ADDFormula()
+void ScOpenCLTest1:: testFinancialDuration_ADDFormula()
{
initTestEnv(u"xls/opencl/financial/Duration_ADD.xls");
ScDocument* pDoc = getScDoc();
@@ -2417,7 +2023,7 @@ void ScOpenCLTest:: testFinancialDuration_ADDFormula()
}
}
-void ScOpenCLTest::testStatisticalFormulaNorminv()
+void ScOpenCLTest1::testStatisticalFormulaNorminv()
{
initTestEnv(u"xls/opencl/statistical/Norminv.xls");
ScDocument* pDoc = getScDoc();
@@ -2433,7 +2039,7 @@ void ScOpenCLTest::testStatisticalFormulaNorminv()
}
}
-void ScOpenCLTest::testStatisticalFormulaNormsinv()
+void ScOpenCLTest1::testStatisticalFormulaNormsinv()
{
initTestEnv(u"xls/opencl/statistical/Normsinv.xls");
ScDocument* pDoc = getScDoc();
@@ -2449,7 +2055,7 @@ void ScOpenCLTest::testStatisticalFormulaNormsinv()
}
}
-void ScOpenCLTest::testMathFormulaArcCosHyp()
+void ScOpenCLTest1::testMathFormulaArcCosHyp()
{
initTestEnv(u"ods/opencl/math/ArcCosHyp.ods");
ScDocument* pDoc = getScDoc();
@@ -2465,7 +2071,7 @@ void ScOpenCLTest::testMathFormulaArcCosHyp()
}
}
-void ScOpenCLTest:: testFinancialMDurationFormula()
+void ScOpenCLTest1:: testFinancialMDurationFormula()
{
initTestEnv(u"xls/opencl/financial/MDuration.xls");
ScDocument* pDoc = getScDoc();
@@ -2480,7 +2086,7 @@ void ScOpenCLTest:: testFinancialMDurationFormula()
}
}
-void ScOpenCLTest::testMathFormulaArcCot()
+void ScOpenCLTest1::testMathFormulaArcCot()
{
initTestEnv(u"ods/opencl/math/ArcCot.ods");
ScDocument* pDoc = getScDoc();
@@ -2496,7 +2102,7 @@ void ScOpenCLTest::testMathFormulaArcCot()
}
}
-void ScOpenCLTest:: testFinancialFVFormula()
+void ScOpenCLTest1:: testFinancialFVFormula()
{
initTestEnv(u"xls/opencl/financial/FV.xls");
ScDocument* pDoc = getScDoc();
@@ -2511,7 +2117,7 @@ void ScOpenCLTest:: testFinancialFVFormula()
}
}
-void ScOpenCLTest::testFinancialDBFormula()
+void ScOpenCLTest1::testFinancialDBFormula()
{
initTestEnv(u"xls/opencl/financial/db.xls");
ScDocument* pDoc = getScDoc();
@@ -2526,7 +2132,7 @@ void ScOpenCLTest::testFinancialDBFormula()
}
}
-void ScOpenCLTest::testFinancialCouppcdFormula()
+void ScOpenCLTest1::testFinancialCouppcdFormula()
{
initTestEnv(u"xls/opencl/financial/Couppcd.xls");
ScDocument* pDoc = getScDoc();
@@ -2541,7 +2147,7 @@ void ScOpenCLTest::testFinancialCouppcdFormula()
}
}
-void ScOpenCLTest::testMathSumIfsFormula()
+void ScOpenCLTest1::testMathSumIfsFormula()
{
initTestEnv(u"xls/opencl/math/sumifs.xls");
ScDocument* pDoc = getScDoc();
@@ -2575,7 +2181,7 @@ void ScOpenCLTest::testMathSumIfsFormula()
}
}
-void ScOpenCLTest::testMathFormulaArcCotHyp()
+void ScOpenCLTest1::testMathFormulaArcCotHyp()
{
initTestEnv(u"ods/opencl/math/ArcCotHyp.ods");
ScDocument* pDoc = getScDoc();
@@ -2591,7 +2197,7 @@ void ScOpenCLTest::testMathFormulaArcCotHyp()
}
}
-void ScOpenCLTest::testMathFormulaArcSin()
+void ScOpenCLTest1::testMathFormulaArcSin()
{
initTestEnv(u"ods/opencl/math/ArcSin.ods");
ScDocument* pDoc = getScDoc();
@@ -2607,7 +2213,7 @@ void ScOpenCLTest::testMathFormulaArcSin()
}
}
-void ScOpenCLTest:: testFinancialVDBFormula()
+void ScOpenCLTest1:: testFinancialVDBFormula()
{
initTestEnv(u"xls/opencl/financial/VDB.xls");
ScDocument* pDoc = getScDoc();
@@ -2634,7 +2240,7 @@ void ScOpenCLTest:: testFinancialVDBFormula()
}
}
-void ScOpenCLTest:: testFinancialIPMTFormula()
+void ScOpenCLTest1:: testFinancialIPMTFormula()
{
initTestEnv(u"xls/opencl/financial/IPMT.xls");
ScDocument* pDoc = getScDoc();
@@ -2649,29 +2255,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();
@@ -2687,23 +2271,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();
@@ -2718,7 +2286,7 @@ void ScOpenCLTest::testFinancialCoupncdFormula()
}
}
-void ScOpenCLTest::testFinancialAccrintFormula()
+void ScOpenCLTest1::testFinancialAccrintFormula()
{
initTestEnv(u"xls/opencl/financial/Accrint.xls");
ScDocument* pDoc = getScDoc();
@@ -2733,7 +2301,7 @@ void ScOpenCLTest::testFinancialAccrintFormula()
}
}
-void ScOpenCLTest::testStatisticalFormulaCritBinom()
+void ScOpenCLTest1::testStatisticalFormulaCritBinom()
{
initTestEnv(u"xls/opencl/statistical/CritBinom.xls");
ScDocument* pDoc = getScDoc();
@@ -2749,7 +2317,7 @@ void ScOpenCLTest::testStatisticalFormulaCritBinom()
}
}
-void ScOpenCLTest::testMathFormulaArcSinHyp()
+void ScOpenCLTest1::testMathFormulaArcSinHyp()
{
initTestEnv(u"ods/opencl/math/ArcSinHyp.ods");
ScDocument* pDoc = getScDoc();
@@ -2765,7 +2333,7 @@ void ScOpenCLTest::testMathFormulaArcSinHyp()
}
}
-void ScOpenCLTest::testMathFormulaArcTan()
+void ScOpenCLTest1::testMathFormulaArcTan()
{
initTestEnv(u"ods/opencl/math/ArcTan.ods");
ScDocument* pDoc = getScDoc();
@@ -2781,7 +2349,7 @@ void ScOpenCLTest::testMathFormulaArcTan()
}
}
-void ScOpenCLTest::testMathFormulaArcTanHyp()
+void ScOpenCLTest1::testMathFormulaArcTanHyp()
{
initTestEnv(u"ods/opencl/math/ArcTanHyp.ods");
ScDocument* pDoc = getScDoc();
@@ -2797,7 +2365,7 @@ void ScOpenCLTest::testMathFormulaArcTanHyp()
}
}
-void ScOpenCLTest:: testFinacialNPER1Formula()
+void ScOpenCLTest1:: testFinacialNPER1Formula()
{
initTestEnv(u"xls/opencl/financial/NPER1.xls");
ScDocument* pDoc = getScDoc();
@@ -2812,39 +2380,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();
@@ -2860,70 +2396,7 @@ void ScOpenCLTest::testMathFormulaBitAnd()
}
}
-void ScOpenCLTest::testStatisticalFormulaPoisson()
-{
- initTestEnv(u"xls/opencl/statistical/Poisson.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));
- }
-}
-
-void ScOpenCLTest::testStatisticalFormulaExpondist()
-{
- initTestEnv(u"xls/opencl/statistical/Expondist.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)
- {
- 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()
+void ScOpenCLTest1::testMathFormulaLN()
{
initTestEnv(u"xls/opencl/math/LN.xls");
ScDocument* pDoc = getScDoc();
@@ -2939,25 +2412,7 @@ void ScOpenCLTest::testMathFormulaLN()
}
}
-void ScOpenCLTest::testMathFormulaMod()
-{
- initTestEnv(u"xls/opencl/math/mod.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()
+void ScOpenCLTest1::testMathFormulaRound()
{
initTestEnv(u"xls/opencl/math/ROUND.xls");
ScDocument* pDoc = getScDoc();
@@ -2979,7 +2434,7 @@ void ScOpenCLTest::testMathFormulaRound()
}
}
-void ScOpenCLTest::testStatisticalFormulaGammaDist()
+void ScOpenCLTest1::testStatisticalFormulaGammaDist()
{
initTestEnv(u"xls/opencl/statistical/GammaDist.xls");
ScDocument* pDoc = getScDoc();
@@ -2995,1514 +2450,12 @@ void ScOpenCLTest::testStatisticalFormulaGammaDist()
}
}
-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)
- {
- 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));
- //CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
- CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.00000000001));
- }
-}
-
-void ScOpenCLTest::testDatabaseFormulaDvar()
-{
- initTestEnv(u"xls/opencl/database/dvar.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::testDatabaseFormulaDvarp()
-{
- initTestEnv(u"xls/opencl/database/dvarp.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::testMathFormulaRoundUp()
-{
- initTestEnv(u"xls/opencl/math/roundup.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));
- }
-}
-
-void ScOpenCLTest::testMathFormulaRoundDown()
-{
- initTestEnv(u"xls/opencl/math/rounddown.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));
- }
-}
-
-void ScOpenCLTest::testMathFormulaInt()
-{
- initTestEnv(u"xls/opencl/math/int.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));
- }
-}
-
-void ScOpenCLTest::testMathFormulaRadians()
-{
- initTestEnv(u"xls/opencl/math/radians.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));
- }
-}
-
-void ScOpenCLTest::testMathFormulaDegrees()
-{
- initTestEnv(u"xls/opencl/math/degrees.xls");
- ScDocument* pDoc = getScDoc();
- ScDocument* pDocRes = getScDoc2();
- pDoc->CalcAll();
-
- for (SCROW i = 0; i <= 200; ++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::testMathFormulaIsEven()
-{
- initTestEnv(u"xls/opencl/math/iseven.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));
- }
-}
-
-void ScOpenCLTest::testMathFormulaCountIf()
-{
- initTestEnv(u"xls/opencl/math/countif.xls");
- ScDocument* pDoc = getScDoc();
- ScDocument* pDocRes = getScDoc2();
- pDoc->CalcAll();
-
- for (SCROW i = 0; i <= 26; ++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::testMathFormulaIsOdd()
-{
- initTestEnv(u"xls/opencl/math/isodd.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));
- }
-}
-
-void ScOpenCLTest::testMathFormulaFact()
-{
- initTestEnv(u"xls/opencl/math/fact.xls");
- ScDocument* pDoc = getScDoc();
- ScDocument* pDocRes = getScDoc2();
- pDoc->CalcAll();
-
- for (SCROW i = 0; i <= 18; ++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::testMathFormulaSEC()
-{
- initTestEnv(u"ods/opencl/math/sec.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::testMathFormulaSECH()
-{
- initTestEnv(u"ods/opencl/math/sech.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::testMathFormulaMROUND()
-{
- initTestEnv(u"xls/opencl/math/MROUND.xls");
- 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::testMathFormulaQuotient()
-{
- initTestEnv(u"ods/opencl/math/Quotient.ods");
- ScDocument* pDoc = getScDoc();
- ScDocument* pDocRes = getScDoc2();
- pDoc->CalcAll();
-
- // Verify BitAnd 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::testMathFormulaSeriesSum()
-{
- initTestEnv(u"xls/opencl/math/seriessum.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::testMathFormulaSumIf()
-{
- initTestEnv(u"xls/opencl/math/sumif.xls");
- ScDocument* pDoc = getScDoc();
- ScDocument* pDocRes = getScDoc2();
- pDoc->CalcAll();
-
- for (SCROW i = 0; 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::testAddInFormulaBesseLJ()
-{
- initTestEnv(u"xls/opencl/addin/besselj.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::testStatisticalFormulaAvedev()
-{
- initTestEnv(u"xls/opencl/statistical/Avedev.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));
- }
-}
-
-void ScOpenCLTest::testNegSub()
-{
- initTestEnv(u"xls/opencl/math/NegSub.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(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
- CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
- }
-}
-
-void ScOpenCLTest::testMathFormulaAverageIf_Mix()
-{
- initTestEnv(u"xls/opencl/math/averageif_mix.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));
- }
-}
-
-void ScOpenCLTest::testStatisticalFormulaKurt1()
-{
- initTestEnv(u"xls/opencl/statistical/Kurt1.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::testStatisticalFormulaHarMean1()
-{
- initTestEnv(u"xls/opencl/statistical/HarMean1.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(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
- CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
- }
-}
-
-void ScOpenCLTest::testStatisticalFormulaVarA1()
-{
- initTestEnv(u"xls/opencl/statistical/VarA1.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::testStatisticalFormulaVarPA1()
-{
- initTestEnv(u"xls/opencl/statistical/VarPA1.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::testStatisticalFormulaStDevA1()
-{
- initTestEnv(u"xls/opencl/statistical/StDevA1.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::testStatisticalFormulaStDevPA1()
-{
- initTestEnv(u"xls/opencl/statistical/StDevPA1.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));
- }
-}
-
-ScOpenCLTest::ScOpenCLTest()
+ScOpenCLTest1::ScOpenCLTest1()
: ScModelTestBase( "sc/qa/unit/data" )
{
}
-CPPUNIT_TEST_SUITE_REGISTRATION(ScOpenCLTest);
+CPPUNIT_TEST_SUITE_REGISTRATION(ScOpenCLTest1);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sc/qa/unit/opencl-test-2.cxx b/sc/qa/unit/opencl-test-2.cxx
new file mode 100644
index 000000000000..e3f79293e1eb
--- /dev/null
+++ b/sc/qa/unit/opencl-test-2.cxx
@@ -0,0 +1,2153 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+
+#include <sal/config.h>
+
+#include <string_view>
+
+#include "helper/qahelper.hxx"
+
+#include <docsh.hxx>
+#include <document.hxx>
+#include <formulagroup.hxx>
+
+#include <com/sun/star/document/MacroExecMode.hpp>
+#include <comphelper/sequence.hxx>
+#include <comphelper/servicehelper.hxx>
+
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
+
+class ScOpenCLTest2
+ : public ScModelTestBase
+{
+public:
+ ScOpenCLTest2();
+
+ /**
+ * Turn on OpenCL group interpreter. Call this after the document is
+ * loaded and before performing formula calculation.
+ */
+ void enableOpenCL();
+ void disableOpenCL();
+
+ 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(ScOpenCLTest2);
+ 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:
+ void initTestEnv(std::u16string_view fileName);
+
+ ScDocument* getScDoc2();
+};
+
+void ScOpenCLTest2::initTestEnv(std::u16string_view fileName)
+{
+ // Some documents contain macros, disable them, otherwise
+ // the "Error, BASIC runtime error." dialog is prompted
+ // and it crashes in tearDown
+ std::vector<beans::PropertyValue> args;
+ beans::PropertyValue aMacroValue;
+ aMacroValue.Name = "MacroExecutionMode";
+ aMacroValue.Handle = -1;
+ aMacroValue.Value <<= document::MacroExecMode::NEVER_EXECUTE;
+ aMacroValue.State = beans::PropertyState_DIRECT_VALUE;
+ args.push_back(aMacroValue);
+
+ disableOpenCL();
+ CPPUNIT_ASSERT(!ScCalcConfig::isOpenCLEnabled());
+
+ // Open the document with OpenCL disabled
+ mxComponent = mxDesktop->loadComponentFromURL(
+ createFileURL(fileName), "_default", 0, comphelper::containerToSequence(args));
+
+ enableOpenCL();
+ CPPUNIT_ASSERT(ScCalcConfig::isOpenCLEnabled());
+
+ // it's not possible to open the same document twice, thus, create a temp file
+ createTempCopy(fileName);
+
+ // Open the document with OpenCL enabled
+ mxComponent2 = mxDesktop->loadComponentFromURL(
+ maTempFile.GetURL(), "_default", 0, comphelper::containerToSequence(args));
+
+ // Check there are 2 documents
+ uno::Reference<frame::XFrames> xFrames = mxDesktop->getFrames();
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), xFrames->getCount());
+}
+
+ScDocument* ScOpenCLTest2::getScDoc2()
+{
+ ScModelObj* pModelObj = comphelper::getFromUnoTunnel<ScModelObj>(mxComponent2);
+ CPPUNIT_ASSERT(pModelObj);
+ return pModelObj->GetDocument();
+}
+
+void ScOpenCLTest2::enableOpenCL()
+{
+ sc::FormulaGroupInterpreter::enableOpenCL_UnitTestsOnly();
+}
+
+void ScOpenCLTest2::disableOpenCL()
+{
+ sc::FormulaGroupInterpreter::disableOpenCL_UnitTestsOnly();
+}
+
+void ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::testStatisticalFormulaPoisson()
+{
+ initTestEnv(u"xls/opencl/statistical/Poisson.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));
+ }
+}
+
+void ScOpenCLTest2::testStatisticalFormulaExpondist()
+{
+ initTestEnv(u"xls/opencl/statistical/Expondist.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 ScOpenCLTest2::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 ScOpenCLTest2::testMathFormulaOdd()
+{
+ initTestEnv(u"xls/opencl/math/odd.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 ScOpenCLTest2::testMathFormulaMod()
+{
+ initTestEnv(u"xls/opencl/math/mod.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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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)
+ {
+ 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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2:: 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 ScOpenCLTest2::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 ScOpenCLTest2:: 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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2:: 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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2:: 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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2:: 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 ScOpenCLTest2::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 ScOpenCLTest2:: 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 ScOpenCLTest2:: 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 ScOpenCLTest2:: 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 ScOpenCLTest2:: 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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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 ScOpenCLTest2::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));
+ //CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.00000000001));
+ }
+}
+
+void ScOpenCLTest2::testDatabaseFormulaDvar()
+{
+ initTestEnv(u"xls/opencl/database/dvar.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 ScOpenCLTest2::testDatabaseFormulaDvarp()
+{
+ initTestEnv(u"xls/opencl/database/dvarp.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 ScOpenCLTest2::testMathFormulaRoundUp()
+{
+ initTestEnv(u"xls/opencl/math/roundup.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));
+ }
+}
+
+void ScOpenCLTest2::testMathFormulaRoundDown()
+{
+ initTestEnv(u"xls/opencl/math/rounddown.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));
+ }
+}
+
+void ScOpenCLTest2::testMathFormulaInt()
+{
+ initTestEnv(u"xls/opencl/math/int.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));
+ }
+}
+
+void ScOpenCLTest2::testMathFormulaRadians()
+{
+ initTestEnv(u"xls/opencl/math/radians.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));
+ }
+}
+
+void ScOpenCLTest2::testMathFormulaDegrees()
+{
+ initTestEnv(u"xls/opencl/math/degrees.xls");
+ ScDocument* pDoc = getScDoc();
+ ScDocument* pDocRes = getScDoc2();
+ pDoc->CalcAll();
+
+ for (SCROW i = 0; i <= 200; ++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 ScOpenCLTest2::testMathFormulaIsEven()
+{
+ initTestEnv(u"xls/opencl/math/iseven.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));
+ }
+}
+
+void ScOpenCLTest2::testMathFormulaCountIf()
+{
+ initTestEnv(u"xls/opencl/math/countif.xls");
+ ScDocument* pDoc = getScDoc();
+ ScDocument* pDocRes = getScDoc2();
+ pDoc->CalcAll();
+
+ for (SCROW i = 0; i <= 26; ++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 ScOpenCLTest2::testMathFormulaIsOdd()
+{
+ initTestEnv(u"xls/opencl/math/isodd.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));
+ }
+}
+
+void ScOpenCLTest2::testMathFormulaFact()
+{
+ initTestEnv(u"xls/opencl/math/fact.xls");
+ ScDocument* pDoc = getScDoc();
+ ScDocument* pDocRes = getScDoc2();
+ pDoc->CalcAll();
+
+ for (SCROW i = 0; i <= 18; ++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 ScOpenCLTest2::testMathFormulaSEC()
+{
+ initTestEnv(u"ods/opencl/math/sec.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 ScOpenCLTest2::testMathFormulaSECH()
+{
+ initTestEnv(u"ods/opencl/math/sech.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 ScOpenCLTest2::testMathFormulaMROUND()
+{
+ initTestEnv(u"xls/opencl/math/MROUND.xls");
+ 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 ScOpenCLTest2::testMathFormulaQuotient()
+{
+ initTestEnv(u"ods/opencl/math/Quotient.ods");
+ ScDocument* pDoc = getScDoc();
+ ScDocument* pDocRes = getScDoc2();
+ pDoc->CalcAll();
+
+ // Verify BitAnd 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 ScOpenCLTest2::testMathFormulaSeriesSum()
+{
+ initTestEnv(u"xls/opencl/math/seriessum.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 ScOpenCLTest2::testMathFormulaSumIf()
+{
+ initTestEnv(u"xls/opencl/math/sumif.xls");
+ ScDocument* pDoc = getScDoc();
+ ScDocument* pDocRes = getScDoc2();
+ pDoc->CalcAll();
+
+ for (SCROW i = 0; 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 ScOpenCLTest2::testAddInFormulaBesseLJ()
+{
+ initTestEnv(u"xls/opencl/addin/besselj.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 ScOpenCLTest2::testStatisticalFormulaAvedev()
+{
+ initTestEnv(u"xls/opencl/statistical/Avedev.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));
+ }
+}
+
+void ScOpenCLTest2::testNegSub()
+{
+ initTestEnv(u"xls/opencl/math/NegSub.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(1,i,0));
+ double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
+ }
+}
+
+void ScOpenCLTest2::testMathFormulaAverageIf_Mix()
+{
+ initTestEnv(u"xls/opencl/math/averageif_mix.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));
+ }
+}
+
+void ScOpenCLTest2::testStatisticalFormulaKurt1()
+{
+ initTestEnv(u"xls/opencl/statistical/Kurt1.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 ScOpenCLTest2::testStatisticalFormulaHarMean1()
+{
+ initTestEnv(u"xls/opencl/statistical/HarMean1.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(1,i,0));
+ double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
+ }
+}
+
+void ScOpenCLTest2::testStatisticalFormulaVarA1()
+{
+ initTestEnv(u"xls/opencl/statistical/VarA1.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 ScOpenCLTest2::testStatisticalFormulaVarPA1()
+{
+ initTestEnv(u"xls/opencl/statistical/VarPA1.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 ScOpenCLTest2::testStatisticalFormulaStDevA1()
+{
+ initTestEnv(u"xls/opencl/statistical/StDevA1.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 ScOpenCLTest2::testStatisticalFormulaStDevPA1()
+{
+ initTestEnv(u"xls/opencl/statistical/StDevPA1.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));
+ }
+}
+
+ScOpenCLTest2::ScOpenCLTest2()
+ : ScModelTestBase( "sc/qa/unit/data" )
+{
+}
+
+CPPUNIT_TEST_SUITE_REGISTRATION(ScOpenCLTest2);
+
+CPPUNIT_PLUGIN_IMPLEMENT();
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */