1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is added by mcw.
6 #include <sal/config.h>
7 #include <unotest/filters-test.hxx>
8 #include <test/bootstrapfixture.hxx>
9 #include <rtl/strbuf.hxx>
10 #include <osl/file.hxx>
13 #include <opencl/platforminfo.hxx>
14 #include <sfx2/app.hxx>
15 #include <sfx2/docfilt.hxx>
16 #include <sfx2/docfile.hxx>
17 #include <sfx2/sfxmodelfactory.hxx>
18 #include <svl/stritem.hxx>
20 #include "helper/qahelper.hxx"
22 #include "calcconfig.hxx"
23 #include "interpre.hxx"
27 #include "patattr.hxx"
28 #include "scitems.hxx"
29 #include "document.hxx"
30 #include "cellform.hxx"
31 #include "drwlayer.hxx"
32 #include "userdat.hxx"
33 #include "formulacell.hxx"
34 #include "formulagroup.hxx"
36 #include <svx/svdpage.hxx>
38 using namespace ::com::sun::star
;
39 using namespace ::com::sun::star::uno
;
41 /* Implementation of Filters test */
44 : public test::FiltersTest
45 , public ScBootstrapFixture
51 * Try to auto-detect OpenCL device if one is available.
53 * @return true if a usable OpenCL device is found, false otherwise.
55 bool detectOpenCLDevice();
58 * Turn on OpenCL group interpreter. Call this after the document is
59 * loaded and before performing formula calculation.
63 virtual void setUp() SAL_OVERRIDE
;
64 virtual void tearDown() SAL_OVERRIDE
;
66 virtual bool load( const OUString
&rFilter
, const OUString
&rURL
,
67 const OUString
&rUserData
, SfxFilterFlags nFilterFlags
,
68 SotClipboardFormatId nClipboardID
, unsigned int nFilterVersion
) SAL_OVERRIDE
;
69 void testSystematic();
70 void testSharedFormulaXLS();
72 void testSharedFormulaXLSGroundWater();
73 void testSharedFormulaXLSStockHistory();
75 void testFinacialFormula();
76 void testStatisticalFormulaFisher();
77 void testStatisticalFormulaFisherInv();
78 void testStatisticalFormulaGamma();
79 void testFinacialFvscheduleFormula();
80 // this test has intermittent failures on OSX
82 void testFinacialIRRFormula();
84 void testFinacialMIRRFormula();
85 void testFinacialRateFormula();
86 void testFinancialAccrintmFormula();
87 void testFinancialAccrintFormula();
88 void testCompilerHorizontal();
89 void testCompilerNested();
90 void testFinacialSLNFormula();
91 void testStatisticalFormulaGammaLn();
92 void testStatisticalFormulaGauss();
93 void testStatisticalFormulaGeoMean();
94 void testStatisticalFormulaHarMean();
95 void testFinancialCoupdaybsFormula();
96 void testFinacialDollardeFormula();
97 void testCompilerString();
98 void testCompilerInEq();
99 void testFinacialDollarfrFormula();
100 void testFinacialSYDFormula();
101 void testStatisticalFormulaCorrel();
102 void testFinancialCoupdaysFormula();
103 void testFinancialCoupdaysncFormula();
104 void testFinacialDISCFormula();
105 void testFinacialINTRATEFormula();
106 void testMathFormulaCos();
107 void testMathFormulaCsc();
108 void testStatisticalFormulaRsq();
109 void testStatisticalFormulaPearson();
110 void testStatisticalFormulaNegbinomdist();
111 void testFinacialXNPVFormula();
112 void testFinacialPriceMatFormula();
113 void testFinacialFormulaReceived();
114 void testFinancialFormulaCumipmt();
115 void testFinancialFormulaCumprinc();
116 void testFinacialRRIFormula();
117 void testFinacialEFFECT_ADDFormula();
118 void testFinacialNominalFormula();
119 void testFinacialTBILLEQFormula();
120 void testFinacialTBILLPRICEFormula();
121 void testFinacialTBILLYIELDFormula();
122 void testFinacialYIELDFormula();
123 void testFinacialYIELDDISCFormula();
124 void testFinacialYIELDMATFormula();
125 void testFinacialPMTFormula();
126 void testFinacialPPMTFormula();
127 void testFinancialISPMTFormula();
128 void testFinacialPriceFormula();
129 void testFinancialDurationFormula();
130 void testFinancialCoupnumFormula();
131 void testMathFormulaSinh();
132 void testMathFormulaAbs();
133 void testFinacialPVFormula();
134 void testMathFormulaSin();
135 void testMathFormulaTan();
136 void testMathFormulaTanH();
137 void testStatisticalFormulaStandard();
138 void testStatisticalFormulaWeibull();
139 void testStatisticalFormulaMedian();
140 void testFinancialDuration_ADDFormula();
141 void testFinancialAmordegrcFormula();
142 void testFinancialAmorlincFormula();
143 void testFinancialDDBFormula();
144 void testFinancialFVFormula();
145 void testFinancialMDurationFormula();
146 void testMathSumIfsFormula();
147 void testFinancialVDBFormula();
148 void testStatisticalFormulaKurt();
149 void testFinacialNPERFormula();
150 void testStatisticalFormulaNormdist();
151 void testMathFormulaArcCos();
152 void testMathFormulaSqrt();
153 void testMathFormulaArcCosHyp();
154 void testFinancialXirrFormula();
155 void testFinacialNPVFormula();
156 void testStatisticalFormulaNormsdist();
157 void testStatisticalFormulaNorminv();
158 void testStatisticalFormulaNormsinv();
159 void testStatisticalFormulaPermut();
160 void testStatisticalFormulaPermutation();
161 void testStatisticalFormulaPhi();
162 void testFinancialIPMTFormula();
163 void testStatisticalFormulaConfidence();
164 void testStatisticalFormulaIntercept();
165 void testFinacialODDLPRICEFormula();
166 void testFinacialOddlyieldFormula();
167 void testFinacialPriceDiscFormula();
168 void testFinancialDBFormula();
169 void testFinancialCouppcdFormula();
170 void testFinancialCoupncdFormula();
171 void testStatisticalFormulaLogInv();
172 void testMathFormulaArcCot();
173 void testMathFormulaCosh();
174 void testStatisticalFormulaCritBinom();
175 void testMathFormulaArcCotHyp();
176 void testMathFormulaArcSin();
177 void testMathFormulaArcSinHyp();
178 void testMathFormulaArcTan();
179 void testMathFormulaArcTanHyp();
180 void testMathFormulaBitAnd();
181 void testStatisticalFormulaForecast();
182 void testStatisticalFormulaLogNormDist();
183 void testStatisticalFormulaGammaDist();
184 void testMathFormulaLN();
185 void testMathFormulaRound();
186 void testMathFormulaCot();
187 void testMathFormulaCoth();
188 void testFinacialNPER1Formula();
189 void testStatisticalFormulaFDist();
190 void testStatisticalFormulaVar();
191 void testStatisticalFormulaChiDist();
192 void testMathFormulaPower();
193 void testMathFormulaOdd();
194 void testStatisticalFormulaChiSqDist();
195 void testStatisticalFormulaChiSqInv();
196 void testStatisticalFormulaGammaInv();
197 void testMathFormulaFloor();
198 void testStatisticalFormulaFInv();
199 void testStatisticalFormulaFTest();
200 void testStatisticalFormulaB();
201 void testStatisticalFormulaBetaDist();
202 void testMathFormulaCscH();
203 void testMathFormulaExp();
204 void testMathFormulaLog10();
205 void testStatisticalFormulaExpondist();
206 void testMathAverageIfsFormula();
207 void testMathCountIfsFormula();
208 void testMathFormulaCombina();
209 void testMathFormulaEven();
210 void testMathFormulaLog();
211 void testMathFormulaMod();
212 void testMathFormulaTrunc();
213 void testStatisticalFormulaSkew();
214 void testMathFormulaArcTan2();
215 void testMathFormulaBitOr();
216 void testMathFormulaBitLshift();
217 void testMathFormulaBitRshift();
218 void testMathFormulaBitXor();
219 void testStatisticalFormulaChiInv();
220 void testStatisticalFormulaPoisson();
221 void testMathFormulaSumSQ();
222 void testStatisticalFormulaSkewp();
223 void testMathFormulaSqrtPi();
224 void testStatisticalFormulaBinomDist();
225 void testStatisticalFormulaVarP();
226 void testMathFormulaCeil();
227 // void testMathFormulaKombin();
228 void testStatisticalFormulaDevSq();
229 void testStatisticalFormulaStDev();
230 void testStatisticalFormulaSlope();
231 void testStatisticalFormulaSTEYX();
232 void testStatisticalFormulaZTest();
233 void testMathFormulaPi();
234 void testMathFormulaRandom();
235 void testMathFormulaConvert();
236 void testMathFormulaProduct();
237 void testStatisticalFormulaHypGeomDist();
238 void testArrayFormulaSumX2MY2();
239 void testArrayFormulaSumX2PY2();
240 void testStatisticalFormulaBetainv();
241 void testStatisticalFormulaTTest();
242 void testStatisticalFormulaTDist();
243 void testStatisticalFormulaTInv();
244 void testArrayFormulaSumXMY2();
245 void testStatisticalFormulaStDevP();
246 void testStatisticalFormulaCovar();
247 void testLogicalFormulaAnd();
248 void testLogicalFormulaOr();
249 void testMathFormulaSumProduct();
250 void testMathFormulaSumProduct2();
251 void testStatisticalParallelCountBug();
252 void testSpreadSheetFormulaVLookup();
253 void testLogicalFormulaNot();
254 void testLogicalFormulaXor();
255 void testDatabaseFormulaDmax();
256 void testDatabaseFormulaDmin();
257 void testDatabaseFormulaDproduct();
258 void testDatabaseFormulaDaverage();
259 void testDatabaseFormulaDstdev();
260 void testDatabaseFormulaDstdevp();
261 void testDatabaseFormulaDsum();
262 void testDatabaseFormulaDvar();
263 void testDatabaseFormulaDvarp();
264 void testMathFormulaAverageIf();
265 void testDatabaseFormulaDcount();
266 void testDatabaseFormulaDcountA();
267 void testMathFormulaDegrees();
268 void testMathFormulaRoundUp();
269 void testMathFormulaRoundDown();
270 void testMathFormulaInt();
271 void testMathFormulaRadians();
272 void testMathFormulaCountIf();
273 void testMathFormulaIsEven();
274 void testMathFormulaIsOdd();
275 void testMathFormulaFact();
276 void testStatisticalFormulaMina();
277 void testStatisticalFormulaCountA();
278 void testStatisticalFormulaMaxa();
279 void testStatisticalFormulaAverageA();
280 void testStatisticalFormulaVarA();
281 void testStatisticalFormulaVarPA();
282 void testStatisticalFormulaStDevA();
283 void testStatisticalFormulaStDevPA();
284 void testMathFormulaSEC();
285 void testMathFormulaSECH();
286 void testMathFormulaMROUND();
287 void testMathFormulaSeriesSum();
288 void testMathFormulaQuotient();
289 void testMathFormulaSumIf();
290 void testAddInFormulaBesseLJ();
292 void testStatisticalFormulaAvedev();
293 void testMathFormulaAverageIf_Mix();
294 void testStatisticalFormulaKurt1();
295 void testStatisticalFormulaHarMean1();
296 void testStatisticalFormulaVarA1();
297 void testStatisticalFormulaVarPA1();
298 void testStatisticalFormulaStDevA1();
299 void testStatisticalFormulaStDevPA1();
300 void testFinancialMDurationFormula1();
302 CPPUNIT_TEST_SUITE(ScOpenCLTest
);
303 CPPUNIT_TEST(testSystematic
);
304 CPPUNIT_TEST(testSharedFormulaXLS
);
305 CPPUNIT_TEST(testFinacialFormula
);
306 CPPUNIT_TEST(testStatisticalFormulaFisher
);
307 CPPUNIT_TEST(testStatisticalFormulaFisherInv
);
308 CPPUNIT_TEST(testStatisticalFormulaGamma
);
309 CPPUNIT_TEST(testFinacialFvscheduleFormula
);
310 // this test has intermittent failures on OSX
312 CPPUNIT_TEST(testFinacialIRRFormula
);
314 CPPUNIT_TEST(testFinacialMIRRFormula
);
315 CPPUNIT_TEST(testFinacialRateFormula
);
316 CPPUNIT_TEST(testCompilerHorizontal
);
317 CPPUNIT_TEST(testCompilerNested
);
318 CPPUNIT_TEST(testFinacialSLNFormula
);
319 CPPUNIT_TEST(testFinancialAccrintmFormula
);
320 CPPUNIT_TEST(testStatisticalFormulaGammaLn
);
321 CPPUNIT_TEST(testStatisticalFormulaGauss
);
322 CPPUNIT_TEST(testStatisticalFormulaGeoMean
);
323 CPPUNIT_TEST(testStatisticalFormulaHarMean
);
324 CPPUNIT_TEST(testFinancialCoupdaybsFormula
);
325 CPPUNIT_TEST(testFinacialDollardeFormula
);
326 CPPUNIT_TEST(testCompilerString
);
327 CPPUNIT_TEST(testCompilerInEq
);
328 CPPUNIT_TEST(testFinacialDollarfrFormula
);
329 CPPUNIT_TEST(testFinacialSYDFormula
);
330 CPPUNIT_TEST(testStatisticalFormulaCorrel
);
331 CPPUNIT_TEST(testFinancialCoupdaysFormula
);
332 CPPUNIT_TEST(testFinancialCoupdaysncFormula
);
333 CPPUNIT_TEST(testFinacialDISCFormula
);
334 CPPUNIT_TEST(testFinacialINTRATEFormula
);
335 CPPUNIT_TEST(testMathFormulaCos
);
336 CPPUNIT_TEST(testStatisticalFormulaNegbinomdist
);
337 CPPUNIT_TEST(testStatisticalFormulaRsq
);
338 CPPUNIT_TEST(testStatisticalFormulaPearson
);
339 CPPUNIT_TEST(testMathFormulaCsc
);
340 CPPUNIT_TEST(testFinacialPriceMatFormula
);
341 CPPUNIT_TEST(testFinacialXNPVFormula
);
342 CPPUNIT_TEST(testFinacialFormulaReceived
);
343 CPPUNIT_TEST(testFinancialFormulaCumipmt
);
344 CPPUNIT_TEST(testFinancialFormulaCumprinc
);
345 CPPUNIT_TEST(testFinacialRRIFormula
);
346 CPPUNIT_TEST(testFinacialEFFECT_ADDFormula
);
347 CPPUNIT_TEST(testFinacialNominalFormula
);
348 CPPUNIT_TEST(testFinacialTBILLEQFormula
);
349 CPPUNIT_TEST(testFinacialTBILLPRICEFormula
);
350 CPPUNIT_TEST(testFinacialTBILLYIELDFormula
);
351 CPPUNIT_TEST(testFinacialYIELDFormula
);
352 CPPUNIT_TEST(testFinacialYIELDDISCFormula
);
353 CPPUNIT_TEST(testFinacialYIELDMATFormula
);
354 CPPUNIT_TEST(testFinacialPPMTFormula
);
355 CPPUNIT_TEST(testFinacialPMTFormula
);
356 CPPUNIT_TEST(testFinancialISPMTFormula
);
357 CPPUNIT_TEST(testFinacialPriceFormula
);
358 CPPUNIT_TEST(testFinancialDurationFormula
);
359 CPPUNIT_TEST(testFinancialCoupnumFormula
);
360 CPPUNIT_TEST(testMathFormulaSinh
);
361 CPPUNIT_TEST(testMathFormulaAbs
);
362 CPPUNIT_TEST(testFinacialPVFormula
);
363 CPPUNIT_TEST(testMathFormulaSin
);
364 CPPUNIT_TEST(testMathFormulaTan
);
365 CPPUNIT_TEST(testMathFormulaTanH
);
366 CPPUNIT_TEST(testStatisticalFormulaStandard
);
367 CPPUNIT_TEST(testStatisticalFormulaWeibull
);
368 CPPUNIT_TEST(testStatisticalFormulaMedian
);
369 CPPUNIT_TEST(testFinancialDuration_ADDFormula
);
370 CPPUNIT_TEST(testFinancialAmordegrcFormula
);
371 CPPUNIT_TEST(testFinancialAmorlincFormula
);
372 CPPUNIT_TEST(testFinancialDDBFormula
);
373 CPPUNIT_TEST(testFinancialFVFormula
);
374 CPPUNIT_TEST(testFinancialMDurationFormula
);
375 CPPUNIT_TEST(testMathSumIfsFormula
);
376 CPPUNIT_TEST(testFinancialVDBFormula
);
377 CPPUNIT_TEST(testStatisticalFormulaKurt
);
378 CPPUNIT_TEST(testFinacialNPERFormula
);
379 CPPUNIT_TEST(testStatisticalFormulaNormdist
);
380 CPPUNIT_TEST(testMathFormulaArcCos
);
381 CPPUNIT_TEST(testMathFormulaSqrt
);
382 CPPUNIT_TEST(testMathFormulaArcCosHyp
);
383 CPPUNIT_TEST(testFinancialXirrFormula
);
384 CPPUNIT_TEST(testFinacialNPVFormula
);
385 CPPUNIT_TEST(testStatisticalFormulaNormsdist
);
386 CPPUNIT_TEST(testStatisticalFormulaNorminv
);
387 CPPUNIT_TEST(testStatisticalFormulaNormsinv
);
388 CPPUNIT_TEST(testStatisticalFormulaPermut
);
389 CPPUNIT_TEST(testStatisticalFormulaPermutation
);
390 CPPUNIT_TEST(testStatisticalFormulaPhi
);
391 CPPUNIT_TEST(testFinancialIPMTFormula
);
392 CPPUNIT_TEST(testStatisticalFormulaConfidence
);
393 CPPUNIT_TEST(testStatisticalFormulaIntercept
);
394 CPPUNIT_TEST(testFinacialODDLPRICEFormula
);
395 CPPUNIT_TEST(testFinacialOddlyieldFormula
);
396 CPPUNIT_TEST(testFinacialPriceDiscFormula
);
397 CPPUNIT_TEST(testFinancialDBFormula
);
398 CPPUNIT_TEST(testFinancialCouppcdFormula
);
399 CPPUNIT_TEST(testFinancialCoupncdFormula
);
400 CPPUNIT_TEST(testFinancialAccrintFormula
);
401 CPPUNIT_TEST(testStatisticalFormulaLogInv
);
402 CPPUNIT_TEST(testMathFormulaArcCot
);
403 CPPUNIT_TEST(testMathFormulaCosh
);
404 CPPUNIT_TEST(testStatisticalFormulaCritBinom
);
405 CPPUNIT_TEST(testMathFormulaArcCotHyp
);
406 CPPUNIT_TEST(testMathFormulaArcSin
);
407 CPPUNIT_TEST(testMathFormulaArcSinHyp
);
408 CPPUNIT_TEST(testMathFormulaArcTan
);
409 CPPUNIT_TEST(testMathFormulaArcTanHyp
);
410 CPPUNIT_TEST(testMathFormulaBitAnd
);
411 CPPUNIT_TEST(testStatisticalFormulaForecast
);
412 CPPUNIT_TEST(testStatisticalFormulaLogNormDist
);
413 CPPUNIT_TEST(testStatisticalFormulaGammaDist
);
414 CPPUNIT_TEST(testMathFormulaLN
);
415 CPPUNIT_TEST(testMathFormulaRound
);
416 CPPUNIT_TEST(testMathFormulaCot
);
417 CPPUNIT_TEST(testMathFormulaCoth
);
418 CPPUNIT_TEST(testFinacialNPER1Formula
);
419 CPPUNIT_TEST(testStatisticalFormulaFDist
);
420 CPPUNIT_TEST(testStatisticalFormulaVar
);
421 CPPUNIT_TEST(testStatisticalFormulaChiDist
);
422 CPPUNIT_TEST(testMathFormulaPower
);
423 CPPUNIT_TEST(testMathFormulaOdd
);
424 CPPUNIT_TEST(testStatisticalFormulaChiSqDist
);
425 CPPUNIT_TEST(testStatisticalFormulaChiSqInv
);
426 CPPUNIT_TEST(testStatisticalFormulaGammaInv
);
427 CPPUNIT_TEST(testMathFormulaFloor
);
428 CPPUNIT_TEST(testStatisticalFormulaFInv
);
429 CPPUNIT_TEST(testStatisticalFormulaFTest
);
430 CPPUNIT_TEST(testStatisticalFormulaB
);
431 CPPUNIT_TEST(testStatisticalFormulaBetaDist
);
432 CPPUNIT_TEST(testMathFormulaCscH
);
433 CPPUNIT_TEST(testMathFormulaExp
);
434 CPPUNIT_TEST(testMathFormulaLog10
);
435 CPPUNIT_TEST(testStatisticalFormulaExpondist
);
436 CPPUNIT_TEST(testMathAverageIfsFormula
);
437 CPPUNIT_TEST(testMathCountIfsFormula
);
438 CPPUNIT_TEST(testMathFormulaCombina
);
439 CPPUNIT_TEST(testMathFormulaEven
);
440 CPPUNIT_TEST(testMathFormulaLog
);
441 CPPUNIT_TEST(testMathFormulaMod
);
442 CPPUNIT_TEST(testMathFormulaTrunc
);
443 CPPUNIT_TEST(testStatisticalFormulaSkew
);
444 CPPUNIT_TEST(testMathFormulaArcTan2
);
445 CPPUNIT_TEST(testMathFormulaBitOr
);
446 CPPUNIT_TEST(testMathFormulaBitLshift
);
447 CPPUNIT_TEST(testMathFormulaBitRshift
);
448 CPPUNIT_TEST(testMathFormulaBitXor
);
449 CPPUNIT_TEST(testStatisticalFormulaChiInv
);
450 CPPUNIT_TEST(testStatisticalFormulaPoisson
);
451 CPPUNIT_TEST(testMathFormulaSumSQ
);
452 CPPUNIT_TEST(testStatisticalFormulaSkewp
);
453 CPPUNIT_TEST(testMathFormulaSqrtPi
);
454 CPPUNIT_TEST(testStatisticalFormulaBinomDist
);
455 CPPUNIT_TEST(testStatisticalFormulaVarP
);
456 CPPUNIT_TEST(testMathFormulaCeil
);
457 // This test fails MacOS 10.8. Disabled temporarily
458 // CPPUNIT_TEST(testMathFormulaKombin);
459 CPPUNIT_TEST(testStatisticalFormulaDevSq
);
460 CPPUNIT_TEST(testStatisticalFormulaStDev
);
461 CPPUNIT_TEST(testStatisticalFormulaSlope
);
462 CPPUNIT_TEST(testStatisticalFormulaSTEYX
);
463 CPPUNIT_TEST(testStatisticalFormulaZTest
);
464 CPPUNIT_TEST(testMathFormulaPi
);
465 CPPUNIT_TEST(testMathFormulaRandom
);
466 CPPUNIT_TEST(testMathFormulaConvert
);
467 CPPUNIT_TEST(testMathFormulaProduct
);
468 CPPUNIT_TEST(testStatisticalFormulaHypGeomDist
);
469 CPPUNIT_TEST(testArrayFormulaSumX2MY2
);
470 CPPUNIT_TEST(testArrayFormulaSumX2PY2
);
471 CPPUNIT_TEST(testStatisticalFormulaBetainv
);
472 CPPUNIT_TEST(testStatisticalFormulaTTest
);
473 CPPUNIT_TEST(testStatisticalFormulaTDist
);
474 CPPUNIT_TEST(testStatisticalFormulaTInv
);
475 CPPUNIT_TEST(testArrayFormulaSumXMY2
);
476 CPPUNIT_TEST(testStatisticalFormulaStDevP
);
477 CPPUNIT_TEST(testStatisticalFormulaCovar
);
478 CPPUNIT_TEST(testLogicalFormulaAnd
);
479 CPPUNIT_TEST(testMathFormulaSumProduct
);
480 CPPUNIT_TEST(testMathFormulaSumProduct2
);
481 CPPUNIT_TEST(testStatisticalParallelCountBug
);
482 CPPUNIT_TEST(testSpreadSheetFormulaVLookup
);
483 CPPUNIT_TEST(testLogicalFormulaOr
);
484 CPPUNIT_TEST(testLogicalFormulaNot
);
485 CPPUNIT_TEST(testLogicalFormulaXor
);
486 CPPUNIT_TEST(testDatabaseFormulaDmax
);
487 CPPUNIT_TEST(testDatabaseFormulaDmin
);
488 CPPUNIT_TEST(testDatabaseFormulaDproduct
);
489 CPPUNIT_TEST(testDatabaseFormulaDaverage
);
490 CPPUNIT_TEST(testDatabaseFormulaDstdev
);
491 CPPUNIT_TEST(testDatabaseFormulaDstdevp
);
492 CPPUNIT_TEST(testDatabaseFormulaDsum
);
493 CPPUNIT_TEST(testDatabaseFormulaDvar
);
494 CPPUNIT_TEST(testDatabaseFormulaDvarp
);
495 CPPUNIT_TEST(testMathFormulaAverageIf
);
496 CPPUNIT_TEST(testDatabaseFormulaDcount
);
497 CPPUNIT_TEST(testDatabaseFormulaDcountA
);
498 CPPUNIT_TEST(testMathFormulaDegrees
);
499 CPPUNIT_TEST(testMathFormulaRoundUp
);
500 CPPUNIT_TEST(testMathFormulaRoundDown
);
501 CPPUNIT_TEST(testMathFormulaInt
);
502 CPPUNIT_TEST(testMathFormulaRadians
);
503 CPPUNIT_TEST(testMathFormulaCountIf
);
504 CPPUNIT_TEST(testMathFormulaIsEven
);
505 CPPUNIT_TEST(testMathFormulaIsOdd
);
506 CPPUNIT_TEST(testMathFormulaFact
);
507 CPPUNIT_TEST(testStatisticalFormulaMaxa
);
508 CPPUNIT_TEST(testStatisticalFormulaMina
);
509 CPPUNIT_TEST(testStatisticalFormulaCountA
);
510 CPPUNIT_TEST(testStatisticalFormulaAverageA
);
511 CPPUNIT_TEST(testStatisticalFormulaVarA
);
512 CPPUNIT_TEST(testStatisticalFormulaVarPA
);
513 CPPUNIT_TEST(testStatisticalFormulaStDevA
);
514 CPPUNIT_TEST(testStatisticalFormulaStDevPA
);
515 CPPUNIT_TEST(testMathFormulaSEC
);
516 CPPUNIT_TEST(testMathFormulaSECH
);
517 CPPUNIT_TEST(testMathFormulaMROUND
);
518 CPPUNIT_TEST(testMathFormulaQuotient
);
519 CPPUNIT_TEST(testMathFormulaSeriesSum
);
520 CPPUNIT_TEST(testMathFormulaSumIf
);
521 CPPUNIT_TEST(testAddInFormulaBesseLJ
);
522 CPPUNIT_TEST(testNegSub
);
523 CPPUNIT_TEST(testStatisticalFormulaAvedev
);
524 CPPUNIT_TEST(testMathFormulaAverageIf_Mix
);
525 CPPUNIT_TEST(testStatisticalFormulaKurt1
);
526 CPPUNIT_TEST(testStatisticalFormulaHarMean1
);
527 CPPUNIT_TEST(testStatisticalFormulaVarA1
);
528 CPPUNIT_TEST(testStatisticalFormulaVarPA1
);
529 CPPUNIT_TEST(testStatisticalFormulaStDevA1
);
530 CPPUNIT_TEST(testStatisticalFormulaStDevPA1
);
531 CPPUNIT_TEST(testFinancialMDurationFormula1
);
532 CPPUNIT_TEST_SUITE_END();
535 uno::Reference
<uno::XInterface
> m_xCalcComponent
;
537 // Test env variables and methods
538 ScDocShellRef xDocSh
;
539 ScDocShellRef xDocShRes
;
540 bool initTestEnv(const OUString
& fileName
, sal_Int32 nFormat
,
544 bool ScOpenCLTest::initTestEnv(const OUString
& fileName
, sal_Int32 nFormat
,
547 if(!detectOpenCLDevice())
550 xDocSh
= loadDoc(fileName
, nFormat
, bReadWrite
);
551 CPPUNIT_ASSERT_MESSAGE("Failed to load document.", xDocSh
.Is());
554 xDocShRes
= loadDoc(fileName
, nFormat
, bReadWrite
);
555 CPPUNIT_ASSERT_MESSAGE("Failed to load document.", xDocShRes
.Is());
560 bool ScOpenCLTest::load(const OUString
&rFilter
, const OUString
&rURL
,
561 const OUString
&rUserData
, SfxFilterFlags nFilterFlags
,
562 SotClipboardFormatId nClipboardID
, unsigned int nFilterVersion
)
564 ScDocShellRef xDocShRef
= ScBootstrapFixture::load(rURL
, rFilter
, rUserData
,
565 OUString(), nFilterFlags
, nClipboardID
, nFilterVersion
);
566 bool bLoaded
= xDocShRef
.Is();
567 //reference counting of ScDocShellRef is very confused.
569 xDocShRef
->DoClose();
573 bool ScOpenCLTest::detectOpenCLDevice()
575 sc::FormulaGroupInterpreter::enableOpenCL_UnitTestsOnly();
576 return sc::FormulaGroupInterpreter::switchOpenCLDevice(OUString(),true);
579 void ScOpenCLTest::enableOpenCL()
581 sc::FormulaGroupInterpreter::enableOpenCL_UnitTestsOnly();
584 void ScOpenCLTest::testCompilerHorizontal()
586 if(!initTestEnv("opencl/compiler/horizontal.", ODS
, false))
588 ScDocument
& rDoc
= xDocSh
->GetDocument();
589 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
592 // Check the results of formula cells in the shared formula range.
593 for (SCROW i
= 1; i
< 5; ++i
)
595 double fLibre
= rDoc
.GetValue(ScAddress(12, i
, 0));
596 double fExcel
= rDocRes
.GetValue(ScAddress(12, i
, 0));
597 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
598 fLibre
= rDoc
.GetValue(ScAddress(13, i
, 0));
599 fExcel
= rDocRes
.GetValue(ScAddress(13, i
, 0));
600 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
601 fLibre
= rDoc
.GetValue(ScAddress(14, i
, 0));
602 fExcel
= rDocRes
.GetValue(ScAddress(14, i
, 0));
603 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
607 void ScOpenCLTest::testCompilerNested()
609 if(!initTestEnv("opencl/compiler/nested.", ODS
, false))
611 ScDocument
& rDoc
= xDocSh
->GetDocument();
612 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
615 // Check the results of formula cells in the shared formula range.
616 for (SCROW i
= 1; i
< 5; ++i
)
618 double fLibre
= rDoc
.GetValue(ScAddress(2, i
, 0));
619 double fExcel
= rDocRes
.GetValue(ScAddress(2, i
, 0));
620 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
624 void ScOpenCLTest::testCompilerString()
626 if(!initTestEnv("opencl/compiler/string.", ODS
, false))
628 ScDocument
& rDoc
= xDocSh
->GetDocument();
629 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
632 // Check the results of formula cells in the shared formula range.
633 for (SCROW i
= 1; i
< 5; ++i
)
635 double fLibre
= rDoc
.GetValue(ScAddress(2, i
, 0));
636 double fExcel
= rDocRes
.GetValue(ScAddress(2, i
, 0));
637 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
639 fLibre
= rDoc
.GetValue(ScAddress(3, i
, 0));
640 fExcel
= rDocRes
.GetValue(ScAddress(3, i
, 0));
641 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
645 void ScOpenCLTest::testCompilerInEq()
647 if(!initTestEnv("opencl/compiler/ineq.", ODS
, false))
649 ScDocument
& rDoc
= xDocSh
->GetDocument();
650 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
653 // Check the results of formula cells in the shared formula range.
654 for (SCROW i
= 1; i
< 7; ++i
)
656 double fLibre
= rDoc
.GetValue(ScAddress(3, i
, 0));
657 double fExcel
= rDocRes
.GetValue(ScAddress(3, i
, 0));
658 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
663 void ScOpenCLTest::testSharedFormulaXLSStockHistory()
665 if(!initTestEnv("stock-history.", XLS
, false))
667 ScDocument
& rDoc
= xDocSh
->GetDocument();
668 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
669 xDocSh
->DoHardRecalc(true);
671 // Check the results of formula cells in the shared formula range.
672 for (SCROW i
= 33; i
< 44; ++i
)
673 { // Cell H34:H44 in S&P 500 (tab 1)
674 double fLibre
= rDoc
.GetValue(ScAddress(7, i
, 1));
675 double fExcel
= rDocRes
.GetValue(ScAddress(7, i
, 1));
676 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, 0.0001*fExcel
);
679 for (SCROW i
= 33; i
< 44; ++i
)
680 { // Cell J34:J44 in S&P 500 (tab 1)
681 double fLibre
= rDoc
.GetValue(ScAddress(9, i
, 1));
682 double fExcel
= rDocRes
.GetValue(ScAddress(9, i
, 1));
683 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, 0.0001*fExcel
);
687 void ScOpenCLTest::testSharedFormulaXLSGroundWater()
689 if(!initTestEnv("ground-water-daily.", XLS
, false))
691 ScDocument
& rDoc
= xDocSh
->GetDocument();
692 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
693 xDocSh
->DoHardRecalc(true);
695 // Check the results of formula cells in the shared formula range.
696 for (SCROW i
= 5; i
<= 77; ++i
)
698 double fLibre
= rDoc
.GetValue(ScAddress(11,i
,1));
699 double fExcel
= rDocRes
.GetValue(ScAddress(11,i
,1));
700 ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
);
707 void ScOpenCLTest::testSystematic()
709 if(!initTestEnv("systematic.", XLS
, false))
712 ScDocument
& rDoc
= xDocSh
->GetDocument();
715 int nAVertBegin(0), nAVertEnd(0), nBVertBegin(0), nBVertEnd(0);
716 int nAHorEnd(0), nBHorEnd(0);
719 for (nRow
= 0; nRow
< 1000; ++nRow
)
721 if (rDoc
.GetString(ScAddress(0, nRow
, 0)) == "a")
723 nAVertBegin
= nRow
+ 1;
725 for (nCol
= 0; nCol
< 1000; ++nCol
)
727 if (rDoc
.GetString(ScAddress(nCol
, nRow
, 0)) != "a")
736 for (; nRow
< 1000; ++nRow
)
738 if (rDoc
.GetString(ScAddress(0, nRow
, 0)) != "a")
745 for (; nRow
< 1000; ++nRow
)
747 if (rDoc
.GetString(ScAddress(0, nRow
, 0)) == "b")
749 nBVertBegin
= nRow
+ 1;
751 for (nCol
= 0; nCol
< 1000; ++nCol
)
753 if (rDoc
.GetString(ScAddress(nCol
, nRow
, 0)) != "b")
762 for (; nRow
< 1000; ++nRow
)
764 if (rDoc
.GetString(ScAddress(0, nRow
, 0)) != "b")
771 CPPUNIT_ASSERT(nAVertBegin
!= 0);
772 CPPUNIT_ASSERT(nBVertBegin
!= 0);
773 CPPUNIT_ASSERT(nAVertEnd
> nAVertBegin
+ 100);
774 CPPUNIT_ASSERT(nBVertEnd
> nBVertBegin
+ 100);
775 CPPUNIT_ASSERT((nAVertEnd
-nAVertBegin
) == (nBVertEnd
-nBVertBegin
));
776 CPPUNIT_ASSERT(nAHorEnd
> 10);
777 CPPUNIT_ASSERT(nBHorEnd
> 10);
778 CPPUNIT_ASSERT(nAHorEnd
== nBHorEnd
);
783 for (SCROW i
= nAVertBegin
; i
< nAVertEnd
; ++i
)
785 for (int j
= 1; j
< nAHorEnd
; ++j
)
787 double fLibre
= rDoc
.GetValue(ScAddress(j
, i
, 0));
788 double fExcel
= rDoc
.GetValue(ScAddress(j
, nBVertBegin
+ (i
- nAVertBegin
), 0));
790 const OString sFailedMessage
=
791 OString(static_cast<sal_Char
>('A'+j
)) +
792 OString::number(i
+1) +
794 OString(static_cast<sal_Char
>('A'+j
)) +
795 OString::number(nBVertBegin
+(i
-nAVertBegin
)+1);
796 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(sFailedMessage
.getStr(), fExcel
, fLibre
, 1e-10);
802 void ScOpenCLTest::testSharedFormulaXLS()
804 if(!initTestEnv("sum_ex.", XLS
, false))
806 ScDocument
& rDoc
= xDocSh
->GetDocument();
807 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
810 // Check the results of formula cells in the shared formula range.
811 for (SCROW i
= 0; i
< 5; ++i
)
813 double fLibre
= rDoc
.GetValue(ScAddress(2, i
, 0));
814 double fExcel
= rDocRes
.GetValue(ScAddress(2, i
, 0));
815 ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
);
818 for (SCROW i
= 6; i
< 14; ++i
)
820 double fLibre
= rDoc
.GetValue(ScAddress(2, i
, 0));
821 double fExcel
= rDocRes
.GetValue(ScAddress(2, i
, 0));
822 ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
);
825 for (SCROW i
= 15; i
< 18; ++i
)
827 double fLibre
= rDoc
.GetValue(ScAddress(2, i
, 0));
828 double fExcel
= rDocRes
.GetValue(ScAddress(2, i
, 0));
829 ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
);
832 for (SCROW i
= 19; i
< 22; ++i
)
834 double fLibre
= rDoc
.GetValue(ScAddress(2, i
, 0));
835 double fExcel
= rDocRes
.GetValue(ScAddress(2, i
, 0));
836 ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
);
839 for (SCROW i
= 23; i
< 25; ++i
)
841 double fLibre
= rDoc
.GetValue(ScAddress(2, i
, 0));
842 //double fExcel = rDocRes.GetValue(ScAddress(2, i, 0));
843 // There seems to be a bug in LibreOffice beta
844 ASSERT_DOUBLES_EQUAL(/*fExcel*/ 60.0, fLibre
);
847 for (SCROW i
= 25; i
< 27; ++i
)
849 double fLibre
= rDoc
.GetValue(ScAddress(2, i
, 0));
850 double fExcel
= rDocRes
.GetValue(ScAddress(2, i
, 0));
851 ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
);
854 for (SCROW i
= 28; i
< 35; ++i
)
856 double fLibre
= rDoc
.GetValue(ScAddress(2, i
, 0));
857 double fExcel
= rDocRes
.GetValue(ScAddress(2, i
, 0));
858 ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
);
861 // workaround for a Calc beta bug
862 ASSERT_DOUBLES_EQUAL(25.0, rDoc
.GetValue(ScAddress(2, 35, 0)));
863 ASSERT_DOUBLES_EQUAL(24.0, rDoc
.GetValue(ScAddress(2, 36, 0)));
865 for (SCROW i
= 38; i
< 43; ++i
)
867 double fLibre
= rDoc
.GetValue(ScAddress(2, i
, 0));
868 double fExcel
= rDocRes
.GetValue(ScAddress(2, i
, 0));
869 ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
);
872 for (SCROW i
= 5; i
< 10; ++i
)
874 double fLibre
= rDoc
.GetValue(ScAddress(5, i
, 1));
875 double fExcel
= rDocRes
.GetValue(ScAddress(5, i
, 1));
876 ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
);
879 for (SCROW i
= 5; i
< 10; ++i
)
881 for (SCCOL j
= 6; j
< 11; ++j
)
883 double fLibre
= rDoc
.GetValue(ScAddress(j
, i
, 1));
884 double fExcel
= rDocRes
.GetValue(ScAddress(j
, i
, 1));
885 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
,
886 fabs(fExcel
*0.0001));
891 void ScOpenCLTest::testMathFormulaCos()
893 if(!initTestEnv("opencl/math/cos.", XLS
, false))
895 ScDocument
& rDoc
= xDocSh
->GetDocument();
896 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
899 for (SCROW i
= 0; i
<= 15; ++i
)
901 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
902 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
903 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
907 void ScOpenCLTest::testMathFormulaSinh()
909 if(!initTestEnv("opencl/math/sinh.", XLS
, false))
911 ScDocument
& rDoc
= xDocSh
->GetDocument();
912 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
913 xDocSh
->DoHardRecalc(true);
915 for (SCROW i
= 0; i
<= 15; ++i
)
917 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
918 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
919 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
923 void ScOpenCLTest::testMathFormulaPi()
925 if(!initTestEnv("opencl/math/pi.", XLS
, false))
927 ScDocument
& rDoc
= xDocSh
->GetDocument();
928 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
931 for (SCROW i
= 0; i
<= 15; ++i
)
933 double fLibre
= rDoc
.GetValue(ScAddress(0,i
,0));
934 double fExcel
= rDocRes
.GetValue(ScAddress(0,i
,0));
935 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
939 void ScOpenCLTest::testMathFormulaRandom()
941 if(!initTestEnv("opencl/math/random.", XLS
, false))
943 ScDocument
& rDoc
= xDocSh
->GetDocument();
944 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
947 for (SCROW i
= 0; i
<= 15; ++i
)
949 double fLibre
= rDoc
.GetValue(ScAddress(0,i
,0));
950 double fExcel
= rDocRes
.GetValue(ScAddress(0,i
,0));
951 //because the random numbers will always change,so give the test "true"
954 CPPUNIT_ASSERT(true);
957 void ScOpenCLTest::testFinacialFormula()
959 if(!initTestEnv("opencl/financial/general.", XLS
, false))
961 ScDocument
& rDoc
= xDocSh
->GetDocument();
962 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
965 // Check the results of formula cells in the shared formula range.
966 for (SCROW i
= 1; i
<= 10; ++i
)
968 double fLibre
= rDoc
.GetValue(ScAddress(2,i
,0));
969 double fExcel
= rDocRes
.GetValue(ScAddress(2,i
,0));
970 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
973 for (SCROW i
= 1; i
<= 10; ++i
)
975 double fLibre
= rDoc
.GetValue(ScAddress(6,i
,1));
976 double fExcel
= rDocRes
.GetValue(ScAddress(6,i
,1));
977 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
980 for (SCROW i
= 1; i
<= 10; ++i
)
982 double fLibre
= rDoc
.GetValue(ScAddress(2,i
,2));
983 double fExcel
= rDocRes
.GetValue(ScAddress(2,i
,2));
984 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
987 for (SCROW i
= 1; i
<= 10; ++i
)
989 double fLibre
= rDoc
.GetValue(ScAddress(6,i
,3));
990 double fExcel
= rDocRes
.GetValue(ScAddress(6,i
,3));
991 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
994 for (SCROW i
= 0; i
<= 9; ++i
)
996 double fLibre
= rDoc
.GetValue(ScAddress(3,i
,4));
997 double fExcel
= rDocRes
.GetValue(ScAddress(3,i
,4));
998 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1001 for (SCROW i
= 0; i
<= 9; ++i
)
1003 double fLibre
= rDoc
.GetValue(ScAddress(3,i
,5));
1004 double fExcel
= rDocRes
.GetValue(ScAddress(3,i
,5));
1005 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1008 for (SCROW i
= 0; i
< 10; ++i
)
1010 double fLibre
= rDoc
.GetValue(ScAddress(5,i
,6));
1011 double fExcel
= rDocRes
.GetValue(ScAddress(5,i
,6));
1012 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1015 for (SCROW i
= 1; i
<= 9; ++i
)
1017 double fLibre
= rDoc
.GetValue(ScAddress(3,i
,7));
1018 double fExcel
= rDocRes
.GetValue(ScAddress(3,i
,7));
1019 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1022 for (SCROW i
= 1; i
<= 10; ++i
)
1024 double fLibre
= rDoc
.GetValue(ScAddress(3,i
,8));
1025 double fExcel
= rDocRes
.GetValue(ScAddress(3,i
,8));
1026 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1029 for (SCROW i
= 1; i
<= 9; ++i
)
1031 double fLibre
= rDoc
.GetValue(ScAddress(3,i
,9));
1032 double fExcel
= rDocRes
.GetValue(ScAddress(3,i
,9));
1033 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1036 for (SCROW i
= 1; i
<= 10; ++i
)
1038 double fLibre
= rDoc
.GetValue(ScAddress(2,i
,10));
1039 double fExcel
= rDocRes
.GetValue(ScAddress(2,i
,10));
1040 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1043 for (SCROW i
= 1; i
<= 10; ++i
)
1045 double fLibre
= rDoc
.GetValue(ScAddress(7,i
,11));
1046 double fExcel
= rDocRes
.GetValue(ScAddress(7,i
,11));
1047 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1050 for (SCROW i
= 1; i
<= 10; ++i
)
1052 double fLibre
= rDoc
.GetValue(ScAddress(5,i
,12));
1053 double fExcel
= rDocRes
.GetValue(ScAddress(5,i
,12));
1054 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1057 for (SCROW i
= 0; i
<= 12; ++i
)
1059 double fLibre
= rDoc
.GetValue(ScAddress(6,i
,13));
1060 double fExcel
= rDocRes
.GetValue(ScAddress(6,i
,13));
1061 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1064 for (SCROW i
= 1; i
<= 10; ++i
)
1066 double fLibre
= rDoc
.GetValue(ScAddress(3,i
,14));
1067 double fExcel
= rDocRes
.GetValue(ScAddress(3,i
,14));
1068 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1071 for (SCROW i
= 1; i
<= 10; ++i
)
1073 double fLibre
= rDoc
.GetValue(ScAddress(6,i
,15));
1074 double fExcel
= rDocRes
.GetValue(ScAddress(6,i
,15));
1075 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1078 for (SCROW i
= 1; i
<= 10; ++i
)
1080 double fLibre
= rDoc
.GetValue(ScAddress(6,i
,16));
1081 double fExcel
= rDocRes
.GetValue(ScAddress(6,i
,16));
1082 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1085 for (SCROW i
= 1; i
<= 5; ++i
)
1087 double fLibre
= rDoc
.GetValue(ScAddress(6,i
,17));
1088 double fExcel
= rDocRes
.GetValue(ScAddress(6,i
,17));
1089 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1092 for (SCROW i
= 0; i
<= 10; ++i
)
1094 double fLibre
= rDoc
.GetValue(ScAddress(3,i
,18));
1095 double fExcel
= rDocRes
.GetValue(ScAddress(3,i
,18));
1096 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1099 for (SCROW i
= 0; i
<= 18; ++i
)
1101 double fLibre
= rDoc
.GetValue(ScAddress(3,i
,19));
1102 double fExcel
= rDocRes
.GetValue(ScAddress(3,i
,19));
1103 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1107 void ScOpenCLTest::testStatisticalFormulaCorrel()
1109 if(!initTestEnv("opencl/statistical/Correl.", ODS
, false))
1111 ScDocument
& rDoc
= xDocSh
->GetDocument();
1112 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1115 // Check the results of formula cells in the shared formula range.
1116 for (SCROW i
= 1; i
<= 20; ++i
)
1118 double fLibre
= rDoc
.GetValue(ScAddress(3, i
, 0));
1119 double fExcel
= rDocRes
.GetValue(ScAddress(3, i
, 0));
1120 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1123 void ScOpenCLTest::testStatisticalFormulaFisher()
1125 if(!initTestEnv("opencl/statistical/Fisher.", XLS
, false))
1127 ScDocument
& rDoc
= xDocSh
->GetDocument();
1128 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1131 // Check the results of formula cells in the shared formula range.
1132 for (SCROW i
= 1; i
<= 19; ++i
)
1134 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
1135 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
1136 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1140 void ScOpenCLTest::testStatisticalFormulaFisherInv()
1142 if(!initTestEnv("opencl/statistical/FisherInv.", XLS
, false))
1144 ScDocument
& rDoc
= xDocSh
->GetDocument();
1145 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1148 // Check the results of formula cells in the shared formula range.
1149 for (SCROW i
= 1; i
<= 19; ++i
)
1151 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
1152 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
1153 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1157 void ScOpenCLTest::testStatisticalFormulaGamma()
1159 if(!initTestEnv("opencl/statistical/Gamma.", XLS
, false))
1161 ScDocument
& rDoc
= xDocSh
->GetDocument();
1162 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1165 // Check the results of formula cells in the shared formula range.
1166 for (SCROW i
= 1; i
<= 19; ++i
)
1168 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
1169 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
1170 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1174 void ScOpenCLTest::testFinacialFvscheduleFormula()
1176 if(!initTestEnv("opencl/financial/Fvschedule.", XLS
, false))
1178 ScDocument
& rDoc
= xDocSh
->GetDocument();
1179 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1182 for (SCROW i
= 0; i
<= 9; ++i
)
1184 double fLibre
= rDoc
.GetValue(ScAddress(2, i
, 0));
1185 double fExcel
= rDocRes
.GetValue(ScAddress(2, i
, 0));
1186 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1190 void ScOpenCLTest::testMathFormulaAbs()
1192 if(!initTestEnv("opencl/math/Abs.", ODS
, false))
1194 ScDocument
& rDoc
= xDocSh
->GetDocument();
1195 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1198 // Verify ABS Function
1199 for (SCROW i
= 1; i
<= 1000; ++i
)
1201 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
1202 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
1203 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1207 void ScOpenCLTest::testFinacialSYDFormula()
1209 if(!initTestEnv("opencl/financial/SYD.", XLS
, false))
1211 ScDocument
& rDoc
= xDocSh
->GetDocument();
1212 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1215 for (SCROW i
= 0; i
<= 9; ++i
)
1217 double fLibre
= rDoc
.GetValue(ScAddress(4, i
, 0));
1218 double fExcel
= rDocRes
.GetValue(ScAddress(4, i
, 0));
1219 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1223 // this test has intermittent failures on OSX
1225 void ScOpenCLTest::testFinacialIRRFormula()
1227 if(!initTestEnv("opencl/financial/IRR.", XLS
, false))
1229 ScDocument
& rDoc
= xDocSh
->GetDocument();
1230 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1233 for (SCROW i
= 0; i
<= 6; ++i
)
1235 double fLibre
= rDoc
.GetValue(ScAddress(2, i
, 0));
1236 double fExcel
= rDocRes
.GetValue(ScAddress(2, i
, 0));
1237 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1242 void ScOpenCLTest::testStatisticalFormulaGammaLn()
1244 if(!initTestEnv("opencl/statistical/GammaLn.", XLS
, false))
1246 ScDocument
& rDoc
= xDocSh
->GetDocument();
1247 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1250 // Check the results of formula cells in the shared formula range.
1251 for (SCROW i
= 1; i
<= 19; ++i
)
1253 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
1254 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
1255 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1259 void ScOpenCLTest::testStatisticalFormulaGauss()
1261 if(!initTestEnv("opencl/statistical/Gauss.", XLS
, false))
1263 ScDocument
& rDoc
= xDocSh
->GetDocument();
1264 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1267 // Check the results of formula cells in the shared formula range.
1268 for (SCROW i
= 1; i
<= 19; ++i
)
1270 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
1271 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
1272 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1276 void ScOpenCLTest::testStatisticalFormulaGeoMean()
1278 if(!initTestEnv("opencl/statistical/GeoMean.", XLS
, false))
1280 ScDocument
& rDoc
= xDocSh
->GetDocument();
1281 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1284 // Check the results of formula cells in the shared formula range.
1285 for (SCROW i
= 1; i
<= 19; ++i
)
1287 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
1288 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
1289 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1293 void ScOpenCLTest::testStatisticalFormulaHarMean()
1295 if(!initTestEnv("opencl/statistical/HarMean.", XLS
, false))
1297 ScDocument
& rDoc
= xDocSh
->GetDocument();
1298 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1301 // Check the results of formula cells in the shared formula range.
1302 for (SCROW i
= 1; i
<= 19; ++i
)
1304 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
1305 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
1306 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1310 void ScOpenCLTest::testFinacialSLNFormula()
1312 if(!initTestEnv("opencl/financial/SLN.", XLS
, false))
1314 ScDocument
& rDoc
= xDocSh
->GetDocument();
1315 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1318 for (SCROW i
= 0; i
<= 9; ++i
)
1320 double fLibre
= rDoc
.GetValue(ScAddress(3, i
, 0));
1321 double fExcel
= rDocRes
.GetValue(ScAddress(3, i
, 0));
1322 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1326 void ScOpenCLTest::testFinacialMIRRFormula()
1328 if(!initTestEnv("opencl/financial/MIRR.", XLS
, false))
1330 ScDocument
& rDoc
= xDocSh
->GetDocument();
1331 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1334 for (SCROW i
= 0; i
<= 6; ++i
)
1336 double fLibre
= rDoc
.GetValue(ScAddress(3, i
, 0));
1337 double fExcel
= rDocRes
.GetValue(ScAddress(3, i
, 0));
1338 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1342 void ScOpenCLTest::testFinancialCoupdaybsFormula()
1344 if(!initTestEnv("opencl/financial/Coupdaybs.", XLS
, false))
1346 ScDocument
& rDoc
= xDocSh
->GetDocument();
1347 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1350 for (SCROW i
= 1; i
<=10; ++i
)
1352 double fLibre
= rDoc
.GetValue(ScAddress(4, i
, 0));
1353 double fExcel
= rDocRes
.GetValue(ScAddress(4, i
, 0));
1354 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1358 void ScOpenCLTest::testFinacialDollardeFormula()
1360 if(!initTestEnv("opencl/financial/Dollarde.", XLS
, false))
1362 ScDocument
& rDoc
= xDocSh
->GetDocument();
1363 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1366 for (SCROW i
= 0; i
<= 9; ++i
)
1368 double fLibre
= rDoc
.GetValue(ScAddress(2, i
, 0));
1369 double fExcel
= rDocRes
.GetValue(ScAddress(2, i
, 0));
1370 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1374 void ScOpenCLTest::testFinancialCoupdaysFormula()
1376 if(!initTestEnv("opencl/financial/Coupdays.", XLS
, false))
1378 ScDocument
& rDoc
= xDocSh
->GetDocument();
1379 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1382 for (SCROW i
= 1; i
<=10; ++i
)
1384 double fLibre
= rDoc
.GetValue(ScAddress(4, i
, 0));
1385 double fExcel
= rDocRes
.GetValue(ScAddress(4, i
, 0));
1386 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1391 void ScOpenCLTest::testFinancialCoupdaysncFormula()
1393 if(!initTestEnv("opencl/financial/Coupdaysnc.", XLS
, false))
1395 ScDocument
& rDoc
= xDocSh
->GetDocument();
1396 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1399 for (SCROW i
= 1; i
<=10; ++i
)
1401 double fLibre
= rDoc
.GetValue(ScAddress(4, i
, 0));
1402 double fExcel
= rDocRes
.GetValue(ScAddress(4, i
, 0));
1403 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1406 void ScOpenCLTest::testFinacialRateFormula()
1408 if(!initTestEnv("opencl/financial/RATE.", XLS
, false))
1410 ScDocument
& rDoc
= xDocSh
->GetDocument();
1411 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1414 for (SCROW i
= 1; i
<= 5; ++i
)
1416 double fLibre
= rDoc
.GetValue(ScAddress(6, i
, 0));
1417 double fExcel
= rDocRes
.GetValue(ScAddress(6, i
, 0));
1418 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1422 void ScOpenCLTest::testFinancialAccrintmFormula()
1424 if(!initTestEnv("opencl/financial/Accrintm.", XLS
, false))
1426 ScDocument
& rDoc
= xDocSh
->GetDocument();
1427 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1430 for (SCROW i
= 1; i
<= 10; ++i
)
1432 double fLibre
= rDoc
.GetValue(ScAddress(5, i
, 0));
1433 double fExcel
= rDocRes
.GetValue(ScAddress(5, i
, 0));
1434 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1438 void ScOpenCLTest::testFinancialCoupnumFormula()
1440 if(!initTestEnv("opencl/financial/Coupnum.", XLS
, false))
1442 ScDocument
& rDoc
= xDocSh
->GetDocument();
1443 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1446 for (SCROW i
= 0; i
<= 9; ++i
)
1448 double fLibre
= rDoc
.GetValue(ScAddress(4, i
, 0));
1449 double fExcel
= rDocRes
.GetValue(ScAddress(4, i
, 0));
1450 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1454 void ScOpenCLTest::testStatisticalFormulaNegbinomdist()
1456 if(!initTestEnv("opencl/statistical/Negbinomdist.", XLS
, false))
1458 ScDocument
& rDoc
= xDocSh
->GetDocument();
1459 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1462 // Check the results of formula cells in the shared formula range.
1463 for (SCROW i
= 0; i
<= 9; ++i
)
1465 double fLibre
= rDoc
.GetValue(ScAddress(3,i
,0));
1466 double fExcel
= rDocRes
.GetValue(ScAddress(3,i
,0));
1467 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1471 void ScOpenCLTest::testMathFormulaSin()
1473 if(!initTestEnv("opencl/math/sin.", XLS
, false))
1475 ScDocument
& rDoc
= xDocSh
->GetDocument();
1476 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1479 for (SCROW i
= 0; i
<= 15; ++i
)
1481 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
1482 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
1483 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1487 void ScOpenCLTest::testMathFormulaSumSQ()
1489 if(!initTestEnv("opencl/math/sumsq.", XLS
, false))
1491 ScDocument
& rDoc
= xDocSh
->GetDocument();
1492 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1495 for (SCROW i
= 0; i
< 20; ++i
)
1497 double fLibre
= rDoc
.GetValue(ScAddress(5,i
,0));
1498 double fExcel
= rDocRes
.GetValue(ScAddress(5,i
,0));
1499 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1503 void ScOpenCLTest::testMathFormulaTan()
1505 if(!initTestEnv("opencl/math/tan.", XLS
, false))
1507 ScDocument
& rDoc
= xDocSh
->GetDocument();
1508 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1511 for (SCROW i
= 0; i
<= 15; ++i
)
1513 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
1514 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
1515 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1519 void ScOpenCLTest::testMathFormulaTanH()
1521 if(!initTestEnv("opencl/math/tanh.", XLS
, false))
1523 ScDocument
& rDoc
= xDocSh
->GetDocument();
1524 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1527 for (SCROW i
= 0; i
<= 15; ++i
)
1529 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
1530 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
1531 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1535 void ScOpenCLTest::testMathFormulaSqrt()
1537 if(!initTestEnv("opencl/math/sqrt.", XLS
, false))
1539 ScDocument
& rDoc
= xDocSh
->GetDocument();
1540 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1543 for (SCROW i
= 0; i
<= 15; ++i
)
1545 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
1546 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
1547 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1551 void ScOpenCLTest::testFinacialPriceFormula()
1553 if(!initTestEnv("opencl/financial/Price.", XLS
, false))
1555 ScDocument
& rDoc
= xDocSh
->GetDocument();
1556 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1559 for (SCROW i
= 1; i
<= 10; ++i
)
1561 double fLibre
= rDoc
.GetValue(ScAddress(7, i
, 0));
1562 double fExcel
= rDocRes
.GetValue(ScAddress(7, i
, 0));
1563 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1567 void ScOpenCLTest::testFinacialDollarfrFormula()
1569 if(!initTestEnv("opencl/financial/Dollarfr.", XLS
, false))
1571 ScDocument
& rDoc
= xDocSh
->GetDocument();
1572 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1575 for (SCROW i
= 0; i
<= 9; ++i
)
1577 double fLibre
= rDoc
.GetValue(ScAddress(2, i
, 0));
1578 double fExcel
= rDocRes
.GetValue(ScAddress(2, i
, 0));
1579 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1583 void ScOpenCLTest::testFinacialPriceDiscFormula()
1585 if(!initTestEnv("opencl/financial/PriceDisc.", XLS
, false))
1587 ScDocument
& rDoc
= xDocSh
->GetDocument();
1588 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1591 for (SCROW i
= 0; i
<= 10; ++i
)
1593 double fLibre
= rDoc
.GetValue(ScAddress(5, i
, 0));
1594 double fExcel
= rDocRes
.GetValue(ScAddress(5, i
, 0));
1595 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1599 void ScOpenCLTest::testFinacialODDLPRICEFormula()
1601 if(!initTestEnv("opencl/financial/Oddlprice.", XLS
, false))
1603 ScDocument
& rDoc
= xDocSh
->GetDocument();
1604 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1607 for (SCROW i
= 1; i
<= 10; ++i
)
1609 double fLibre
= rDoc
.GetValue(ScAddress(8, i
, 0));
1610 double fExcel
= rDocRes
.GetValue(ScAddress(8, i
, 0));
1611 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1615 void ScOpenCLTest:: testFinacialOddlyieldFormula()
1617 if(!initTestEnv("opencl/financial/Oddlyield.", XLS
, false))
1619 ScDocument
& rDoc
= xDocSh
->GetDocument();
1620 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1623 for (SCROW i
= 0; i
<= 6; ++i
)
1625 double fLibre
= rDoc
.GetValue(ScAddress(8, i
, 0));
1626 double fExcel
= rDocRes
.GetValue(ScAddress(8, i
, 0));
1627 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1631 void ScOpenCLTest::testFinacialDISCFormula()
1633 if(!initTestEnv("opencl/financial/DISC.", XLS
, false))
1635 ScDocument
& rDoc
= xDocSh
->GetDocument();
1636 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1639 for (SCROW i
= 0; i
<= 9; ++i
)
1641 double fLibre
= rDoc
.GetValue(ScAddress(5, i
, 0));
1642 double fExcel
= rDocRes
.GetValue(ScAddress(5, i
, 0));
1643 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1647 void ScOpenCLTest:: testFinacialPVFormula()
1649 if(!initTestEnv("opencl/financial/PV.", XLS
, false))
1651 ScDocument
& rDoc
= xDocSh
->GetDocument();
1652 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1655 for (SCROW i
= 0; i
<= 9; ++i
)
1657 double fLibre
= rDoc
.GetValue(ScAddress(5, i
, 0));
1658 double fExcel
= rDocRes
.GetValue(ScAddress(5, i
, 0));
1659 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1663 void ScOpenCLTest::testFinacialINTRATEFormula()
1665 if(!initTestEnv("opencl/financial/INTRATE.", XLS
, false))
1667 ScDocument
& rDoc
= xDocSh
->GetDocument();
1668 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1671 for (SCROW i
= 0; i
<= 9; ++i
)
1673 double fLibre
= rDoc
.GetValue(ScAddress(5, i
, 0));
1674 double fExcel
= rDocRes
.GetValue(ScAddress(5, i
, 0));
1675 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1679 void ScOpenCLTest::testStatisticalFormulaStandard()
1681 if(!initTestEnv("opencl/statistical/Standard.", XLS
, false))
1683 ScDocument
& rDoc
= xDocSh
->GetDocument();
1684 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1687 // Check the results of formula cells in the shared formula range.
1688 for (SCROW i
= 1; i
<= 20; ++i
)
1690 double fLibre
= rDoc
.GetValue(ScAddress(3,i
,0));
1691 double fExcel
= rDocRes
.GetValue(ScAddress(3,i
,0));
1692 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1696 void ScOpenCLTest::testStatisticalFormulaWeibull()
1698 if(!initTestEnv("opencl/statistical/Weibull.", XLS
, false))
1700 ScDocument
& rDoc
= xDocSh
->GetDocument();
1701 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1704 // Check the results of formula cells in the shared formula range.
1705 for (SCROW i
= 1; i
<= 20; ++i
)
1707 double fLibre
= rDoc
.GetValue(ScAddress(4,i
,0));
1708 double fExcel
= rDocRes
.GetValue(ScAddress(4,i
,0));
1709 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
,
1710 fExcel
== 0?1e-4:fabs(1e-4*fExcel
));
1714 void ScOpenCLTest::testStatisticalFormulaVar()
1716 if(!initTestEnv("opencl/statistical/Var.", XLS
, false))
1718 ScDocument
& rDoc
= xDocSh
->GetDocument();
1719 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1722 // Check the results of formula cells in the shared formula range.
1723 for (SCROW i
= 1; i
<= 20; ++i
)
1725 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
1726 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
1727 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1731 void ScOpenCLTest::testStatisticalFormulaSkew()
1733 if(!initTestEnv("opencl/statistical/Skew.", XLS
, false))
1735 ScDocument
& rDoc
= xDocSh
->GetDocument();
1736 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1739 // Check the results of formula cells in the shared formula range.
1740 for (SCROW i
= 1; i
<= 20; ++i
)
1742 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
1743 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
1744 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1748 void ScOpenCLTest::testStatisticalFormulaSkewp()
1750 if(!initTestEnv("opencl/statistical/Skewp.", XLS
, false))
1752 ScDocument
& rDoc
= xDocSh
->GetDocument();
1753 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1756 // Check the results of formula cells in the shared formula range.
1757 for (SCROW i
= 1; i
<= 20; ++i
)
1759 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
1760 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
1761 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1765 void ScOpenCLTest::testStatisticalFormulaPearson()
1767 if(!initTestEnv("opencl/statistical/Pearson.", XLS
, false))
1769 ScDocument
& rDoc
= xDocSh
->GetDocument();
1770 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1773 // Check the results of formula cells in the shared formula range.
1774 for (SCROW i
= 1; i
<= 9; ++i
)
1776 double fLibre
= rDoc
.GetValue(ScAddress(2,i
,0));
1777 double fExcel
= rDocRes
.GetValue(ScAddress(2,i
,0));
1778 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1782 void ScOpenCLTest::testStatisticalFormulaRsq()
1784 if(!initTestEnv("opencl/statistical/Rsq.", XLS
, false))
1786 ScDocument
& rDoc
= xDocSh
->GetDocument();
1787 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1790 // Check the results of formula cells in the shared formula range.
1791 for (SCROW i
= 1; i
<= 9; ++i
)
1793 double fLibre
= rDoc
.GetValue(ScAddress(2,i
,0));
1794 double fExcel
= rDocRes
.GetValue(ScAddress(2,i
,0));
1795 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1799 void ScOpenCLTest::testMathFormulaTrunc()
1801 if(!initTestEnv("opencl/math/trunc.", XLS
, false))
1803 ScDocument
& rDoc
= xDocSh
->GetDocument();
1804 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1807 for (SCROW i
= 0; i
<= 15; ++i
)
1809 double fLibre
= rDoc
.GetValue(ScAddress(2,i
,0));
1810 double fExcel
= rDocRes
.GetValue(ScAddress(2,i
,0));
1811 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1815 void ScOpenCLTest::testMathFormulaCosh()
1817 if(!initTestEnv("opencl/math/cosh.", XLS
, false))
1819 ScDocument
& rDoc
= xDocSh
->GetDocument();
1820 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1823 for (SCROW i
= 0; i
<= 15; ++i
)
1825 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
1826 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
1827 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1830 void ScOpenCLTest::testStatisticalFormulaCovar()
1832 if(!initTestEnv("opencl/statistical/Covar.", XLS
, false))
1834 ScDocument
& rDoc
= xDocSh
->GetDocument();
1835 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1838 // Check the results of formula cells in the shared formula range.
1839 for (SCROW i
= 0; i
<= 16; ++i
)
1841 double fLibre
= rDoc
.GetValue(ScAddress(2,i
,0));
1842 double fExcel
= rDocRes
.GetValue(ScAddress(2,i
,0));
1843 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1847 void ScOpenCLTest::testStatisticalFormulaKurt()
1849 if(!initTestEnv("opencl/statistical/Kurt.", XLS
, false))
1851 ScDocument
& rDoc
= xDocSh
->GetDocument();
1852 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1855 // Check the results of formula cells in the shared formula range.
1856 for (SCROW i
= 1; i
<= 19; ++i
)
1858 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
1859 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
1860 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1864 void ScOpenCLTest::testMathFormulaCot()
1866 if(!initTestEnv("opencl/math/cot.", ODS
, false))
1868 ScDocument
& rDoc
= xDocSh
->GetDocument();
1869 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1872 for (SCROW i
= 0; i
<= 15; ++i
)
1874 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
1875 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
1876 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1880 void ScOpenCLTest::testStatisticalFormulaDevSq()
1882 if(!initTestEnv("opencl/statistical/DevSq.", XLS
, false))
1884 ScDocument
& rDoc
= xDocSh
->GetDocument();
1885 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1888 // Check the results of formula cells in the shared formula range.
1889 for (SCROW i
= 0; i
<= 11; ++i
)
1891 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
1892 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
1893 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1897 void ScOpenCLTest::testMathFormulaCsc()
1899 if(!initTestEnv("opencl/math/csc.", ODS
, false))
1901 ScDocument
& rDoc
= xDocSh
->GetDocument();
1902 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1905 for (SCROW i
= 0; i
<= 15; ++i
)
1907 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
1908 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
1909 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1913 void ScOpenCLTest::testMathFormulaCoth()
1915 if(!initTestEnv("opencl/math/coth.", ODS
, false))
1917 ScDocument
& rDoc
= xDocSh
->GetDocument();
1918 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1921 for (SCROW i
= 0; i
<= 15; ++i
)
1923 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
1924 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
1925 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1929 void ScOpenCLTest::testFinacialXNPVFormula()
1931 if(!initTestEnv("opencl/financial/XNPV.", XLS
, false))
1933 ScDocument
& rDoc
= xDocSh
->GetDocument();
1934 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1937 for (SCROW i
= 1; i
<= 9; ++i
)
1939 double fLibre
= rDoc
.GetValue(ScAddress(3, i
, 0));
1940 double fExcel
= rDocRes
.GetValue(ScAddress(3, i
, 0));
1941 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1944 for (SCROW i
= 16; i
<= 26; ++i
)
1946 double fLibre
= rDoc
.GetValue(ScAddress(3, i
, 0));
1947 double fExcel
= rDocRes
.GetValue(ScAddress(3, i
, 0));
1948 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1952 void ScOpenCLTest::testStatisticalFormulaIntercept()
1954 if(!initTestEnv("opencl/statistical/Intercept.", XLS
, false))
1956 ScDocument
& rDoc
= xDocSh
->GetDocument();
1957 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1960 for (SCROW i
= 1; i
<= 19; ++i
)
1962 double fLibre
= rDoc
.GetValue(ScAddress(2,i
,0));
1963 double fExcel
= rDocRes
.GetValue(ScAddress(2,i
,0));
1964 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1968 void ScOpenCLTest::testFinancialAmordegrcFormula()
1970 if(!initTestEnv("opencl/financial/Amordegrc.", XLS
, false))
1972 ScDocument
& rDoc
= xDocSh
->GetDocument();
1973 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1976 for (SCROW i
= 0; i
<= 9; ++i
)
1978 double fLibre
= rDoc
.GetValue(ScAddress(7, i
, 0));
1979 double fExcel
= rDocRes
.GetValue(ScAddress(7, i
, 0));
1980 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
1984 void ScOpenCLTest:: testFinancialISPMTFormula()
1986 if(!initTestEnv("opencl/financial/ISPMT.", XLS
, false))
1988 ScDocument
& rDoc
= xDocSh
->GetDocument();
1989 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
1992 for (SCROW i
= 0; i
<= 9; ++i
)
1994 double fLibre
= rDoc
.GetValue(ScAddress(4, i
, 0));
1995 double fExcel
= rDocRes
.GetValue(ScAddress(4, i
, 0));
1996 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2000 void ScOpenCLTest::testStatisticalFormulaMedian()
2002 if(!initTestEnv("opencl/statistical/Median.", XLS
, false))
2004 ScDocument
& rDoc
= xDocSh
->GetDocument();
2005 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2008 // Check the results of formula cells in the shared formula range.
2009 for (SCROW i
= 1; i
<= 9; ++i
)
2011 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
2012 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
2013 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2017 void ScOpenCLTest::testStatisticalFormulaNormdist()
2019 if(!initTestEnv("opencl/statistical/Normdist.", XLS
, false))
2021 ScDocument
& rDoc
= xDocSh
->GetDocument();
2022 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2025 // Check the results of formula cells in the shared formula range.
2026 for (SCROW i
= 1; i
<= 19; ++i
)
2028 double fLibre
= rDoc
.GetValue(ScAddress(4,i
,0));
2029 double fExcel
= rDocRes
.GetValue(ScAddress(4,i
,0));
2030 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2034 void ScOpenCLTest::testStatisticalFormulaNormsdist()
2036 if(!initTestEnv("opencl/statistical/Normsdist.", XLS
, false))
2038 ScDocument
& rDoc
= xDocSh
->GetDocument();
2039 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2042 // Check the results of formula cells in the shared formula range.
2043 for (SCROW i
= 1; i
<= 19; ++i
)
2045 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
2046 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
2047 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2051 void ScOpenCLTest::testStatisticalFormulaPermut()
2053 if(!initTestEnv("opencl/statistical/Permut.", XLS
, false))
2055 ScDocument
& rDoc
= xDocSh
->GetDocument();
2056 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2059 // Check the results of formula cells in the shared formula range.
2060 for (SCROW i
= 1; i
<= 19; ++i
)
2062 double fLibre
= rDoc
.GetValue(ScAddress(2,i
,0));
2063 double fExcel
= rDocRes
.GetValue(ScAddress(2,i
,0));
2064 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2068 void ScOpenCLTest::testStatisticalFormulaPermutation()
2070 if(!initTestEnv("opencl/statistical/Permutation.", XLS
, false))
2072 ScDocument
& rDoc
= xDocSh
->GetDocument();
2073 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2076 // Check the results of formula cells in the shared formula range.
2077 for (SCROW i
= 1; i
<= 9; ++i
)
2079 double fLibre
= rDoc
.GetValue(ScAddress(2,i
,0));
2080 double fExcel
= rDocRes
.GetValue(ScAddress(2,i
,0));
2081 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2085 void ScOpenCLTest::testStatisticalFormulaPhi()
2087 if(!initTestEnv("opencl/statistical/Phi.", XLS
, false))
2089 ScDocument
& rDoc
= xDocSh
->GetDocument();
2090 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2093 // Check the results of formula cells in the shared formula range.
2094 for (SCROW i
= 1; i
<= 19; ++i
)
2096 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
2097 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
2098 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2102 void ScOpenCLTest::testMathFormulaCscH()
2104 if(!initTestEnv("opencl/math/csch.", ODS
, false))
2106 ScDocument
& rDoc
= xDocSh
->GetDocument();
2107 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2110 for (SCROW i
= 0; i
<= 15; ++i
)
2112 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
2113 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
2114 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2118 void ScOpenCLTest::testStatisticalFormulaLogInv()
2120 if(!initTestEnv("opencl/statistical/LogInv.", XLS
, false))
2122 ScDocument
& rDoc
= xDocSh
->GetDocument();
2123 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2126 // Check the results of formula cells in the shared formula range.
2127 for (SCROW i
= 1; i
<= 19; ++i
)
2129 double fLibre
= rDoc
.GetValue(ScAddress(3,i
,0));
2130 double fExcel
= rDocRes
.GetValue(ScAddress(3,i
,0));
2131 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2135 void ScOpenCLTest::testFinacialNPERFormula()
2137 if(!initTestEnv("opencl/financial/NPER.", XLS
, false))
2139 ScDocument
& rDoc
= xDocSh
->GetDocument();
2140 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2143 for (SCROW i
= 0; i
<= 10; ++i
)
2145 double fLibre
= rDoc
.GetValue(ScAddress(5, i
, 0));
2146 double fExcel
= rDocRes
.GetValue(ScAddress(5, i
, 0));
2147 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2151 void ScOpenCLTest::testStatisticalFormulaForecast()
2153 if(!initTestEnv("opencl/statistical/Forecast.", XLS
, false))
2155 ScDocument
& rDoc
= xDocSh
->GetDocument();
2156 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2159 // Check the results of formula cells in the shared formula range.
2160 for (SCROW i
= 1; i
<= 19; ++i
)
2162 double fLibre
= rDoc
.GetValue(ScAddress(3,i
,0));
2163 double fExcel
= rDocRes
.GetValue(ScAddress(3,i
,0));
2164 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2168 void ScOpenCLTest::testFinancialAmorlincFormula()
2170 if(!initTestEnv("opencl/financial/Amorlinc.", XLS
, false))
2172 ScDocument
& rDoc
= xDocSh
->GetDocument();
2173 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2176 for (SCROW i
= 0; i
<= 9; ++i
)
2178 double fLibre
= rDoc
.GetValue(ScAddress(7, i
, 0));
2179 double fExcel
= rDocRes
.GetValue(ScAddress(7, i
, 0));
2180 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2184 void ScOpenCLTest::testFinancialDDBFormula()
2186 if(!initTestEnv("opencl/financial/ddb.", XLS
, false))
2188 ScDocument
& rDoc
= xDocSh
->GetDocument();
2189 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2192 for (SCROW i
= 0; i
<= 9; ++i
)
2194 double fLibre
= rDoc
.GetValue(ScAddress(5, i
, 0));
2195 double fExcel
= rDocRes
.GetValue(ScAddress(5, i
, 0));
2196 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2199 void ScOpenCLTest::testFinacialPriceMatFormula()
2201 if(!initTestEnv("opencl/financial/PriceMat.", XLS
, false))
2203 ScDocument
& rDoc
= xDocSh
->GetDocument();
2204 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2207 for (SCROW i
= 0; i
<= 9; ++i
)
2209 double fLibre
= rDoc
.GetValue(ScAddress(6, i
, 0));
2210 double fExcel
= rDocRes
.GetValue(ScAddress(6, i
, 0));
2211 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2214 void ScOpenCLTest::testFinacialFormulaReceived()
2216 if(!initTestEnv("opencl/financial/Received.", XLS
, false))
2218 ScDocument
& rDoc
= xDocSh
->GetDocument();
2219 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2222 // Check the results of formula cells in the shared formula range.
2223 for (SCROW i
= 0; i
< 10; ++i
)
2225 double fLibre
= rDoc
.GetValue(ScAddress(5,i
,0));
2226 double fExcel
= rDocRes
.GetValue(ScAddress(5,i
,0));
2227 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2230 void ScOpenCLTest::testFinancialFormulaCumipmt()
2232 if(!initTestEnv("opencl/financial/Cumipmt.", XLS
, false))
2234 ScDocument
& rDoc
= xDocSh
->GetDocument();
2235 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2238 // Check the results of formula cells in the shared formula range.
2239 for (SCROW i
= 1; i
<= 10; ++i
)
2241 double fLibre
= rDoc
.GetValue(ScAddress(6,i
,0));
2242 double fExcel
= rDocRes
.GetValue(ScAddress(6,i
,0));
2243 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2246 void ScOpenCLTest::testFinancialFormulaCumprinc()
2248 if(!initTestEnv("opencl/financial/Cumprinc.", XLS
, false))
2250 ScDocument
& rDoc
= xDocSh
->GetDocument();
2251 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2254 // Check the results of formula cells in the shared formula range.
2255 for (SCROW i
= 1; i
<= 10; ++i
)
2257 double fLibre
= rDoc
.GetValue(ScAddress(6,i
,0));
2258 double fExcel
= rDocRes
.GetValue(ScAddress(6,i
,0));
2259 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2262 void ScOpenCLTest::testFinacialRRIFormula()
2264 if(!initTestEnv("opencl/financial/RRI.", XLS
, false))
2266 ScDocument
& rDoc
= xDocSh
->GetDocument();
2267 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2270 for (SCROW i
= 0; i
<= 9; ++i
)
2272 double fLibre
= rDoc
.GetValue(ScAddress(3, i
, 0));
2273 double fExcel
= rDocRes
.GetValue(ScAddress(3, i
, 0));
2274 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2277 void ScOpenCLTest::testFinacialEFFECT_ADDFormula()
2279 if(!initTestEnv("opencl/financial/EFFECT_ADD.", XLS
, false))
2281 ScDocument
& rDoc
= xDocSh
->GetDocument();
2282 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2285 for (SCROW i
= 0; i
<= 9; ++i
)
2287 double fLibre
= rDoc
.GetValue(ScAddress(2, i
, 0));
2288 double fExcel
= rDocRes
.GetValue(ScAddress(2, i
, 0));
2289 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2292 void ScOpenCLTest::testFinacialNominalFormula()
2294 if(!initTestEnv("opencl/financial/Nominal.", XLS
, false))
2296 ScDocument
& rDoc
= xDocSh
->GetDocument();
2297 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2301 // Check the results of formula cells in the shared formula range.
2302 for (SCROW i
= 1; i
<= 19; ++i
)
2304 double fLibre
= rDoc
.GetValue(ScAddress(3,i
,0));
2305 double fExcel
= rDocRes
.GetValue(ScAddress(3,i
,0));
2306 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2309 void ScOpenCLTest::testFinacialTBILLEQFormula()
2311 if(!initTestEnv("opencl/financial/TBILLEQ.", XLS
, false))
2313 ScDocument
& rDoc
= xDocSh
->GetDocument();
2314 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2317 for (SCROW i
= 0; i
<= 6; ++i
)
2319 double fLibre
= rDoc
.GetValue(ScAddress(3, i
, 0));
2320 double fExcel
= rDocRes
.GetValue(ScAddress(3, i
, 0));
2321 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2324 void ScOpenCLTest::testFinacialTBILLPRICEFormula()
2326 if(!initTestEnv("opencl/financial/TBILLPRICE.", XLS
, false))
2328 ScDocument
& rDoc
= xDocSh
->GetDocument();
2329 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2332 for (SCROW i
= 0; i
<= 6; ++i
)
2334 double fLibre
= rDoc
.GetValue(ScAddress(3, i
, 0));
2335 double fExcel
= rDocRes
.GetValue(ScAddress(3, i
, 0));
2336 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2339 void ScOpenCLTest::testFinacialTBILLYIELDFormula()
2341 if(!initTestEnv("opencl/financial/TBILLYIELD.", XLS
, false))
2343 ScDocument
& rDoc
= xDocSh
->GetDocument();
2344 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2347 for (SCROW i
= 0; i
<= 6; ++i
)
2349 double fLibre
= rDoc
.GetValue(ScAddress(3, i
, 0));
2350 double fExcel
= rDocRes
.GetValue(ScAddress(3, i
, 0));
2351 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2354 void ScOpenCLTest::testFinacialYIELDFormula()
2356 if(!initTestEnv("opencl/financial/YIELD.", XLS
, false))
2358 ScDocument
& rDoc
= xDocSh
->GetDocument();
2359 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2362 for (SCROW i
= 0; i
<= 6; ++i
)
2364 double fLibre
= rDoc
.GetValue(ScAddress(7, i
, 0));
2365 double fExcel
= rDocRes
.GetValue(ScAddress(7, i
, 0));
2366 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2370 void ScOpenCLTest::testFinacialYIELDDISCFormula()
2372 if(!initTestEnv("opencl/financial/YIELDDISC.", XLS
, false))
2374 ScDocument
& rDoc
= xDocSh
->GetDocument();
2375 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2378 for (SCROW i
= 0; i
<= 6; ++i
)
2380 double fLibre
= rDoc
.GetValue(ScAddress(5, i
, 0));
2381 double fExcel
= rDocRes
.GetValue(ScAddress(5, i
, 0));
2382 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2386 void ScOpenCLTest::testFinacialYIELDMATFormula()
2388 if(!initTestEnv("opencl/financial/YIELDMAT.", XLS
, false))
2390 ScDocument
& rDoc
= xDocSh
->GetDocument();
2391 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2394 for (SCROW i
= 0; i
<= 6; ++i
)
2396 double fLibre
= rDoc
.GetValue(ScAddress(6, i
, 0));
2397 double fExcel
= rDocRes
.GetValue(ScAddress(6, i
, 0));
2398 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2401 void ScOpenCLTest:: testFinacialPMTFormula()
2403 if(!initTestEnv("opencl/financial/PMT.", XLS
, false))
2405 ScDocument
& rDoc
= xDocSh
->GetDocument();
2406 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2409 for (SCROW i
= 0; i
<= 6; ++i
)
2411 double fLibre
= rDoc
.GetValue(ScAddress(5, i
, 0));
2412 double fExcel
= rDocRes
.GetValue(ScAddress(5, i
, 0));
2413 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2417 void ScOpenCLTest:: testFinancialDurationFormula()
2419 if(!initTestEnv("opencl/financial/Duration.", ODS
, false))
2421 ScDocument
& rDoc
= xDocSh
->GetDocument();
2422 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2425 for (SCROW i
= 0; i
<= 9; ++i
)
2427 double fLibre
= rDoc
.GetValue(ScAddress(3, i
, 0));
2428 double fExcel
= rDocRes
.GetValue(ScAddress(3, i
, 0));
2429 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2433 void ScOpenCLTest::testStatisticalFormulaLogNormDist()
2435 if(!initTestEnv("opencl/statistical/LogNormDist.", ODS
, false))
2437 ScDocument
& rDoc
= xDocSh
->GetDocument();
2438 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2441 // Check the results of formula cells in the shared formula range.
2442 for (SCROW i
= 1; i
<= 19; ++i
)
2444 double fLibre
= rDoc
.GetValue(ScAddress(4,i
,0));
2445 double fExcel
= rDocRes
.GetValue(ScAddress(4,i
,0));
2446 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2450 void ScOpenCLTest::testMathFormulaArcCos()
2452 if(!initTestEnv("opencl/math/ArcCos.", ODS
, false))
2454 ScDocument
& rDoc
= xDocSh
->GetDocument();
2455 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2458 // Verify ACos Function
2459 for (SCROW i
= 1; i
<= 1000; ++i
)
2461 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
2462 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
2463 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2467 void ScOpenCLTest::testMathFormulaPower()
2469 if(!initTestEnv("opencl/math/power.", ODS
, false))
2471 ScDocument
& rDoc
= xDocSh
->GetDocument();
2472 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2475 for (SCROW i
= 0; i
<= 15; ++i
)
2477 double fLibre
= rDoc
.GetValue(ScAddress(2,i
,0));
2478 double fExcel
= rDocRes
.GetValue(ScAddress(2,i
,0));
2479 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2483 void ScOpenCLTest:: testFinacialPPMTFormula()
2485 if(!initTestEnv("opencl/financial/PPMT.", XLS
, false))
2487 ScDocument
& rDoc
= xDocSh
->GetDocument();
2488 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2491 for (SCROW i
= 0; i
<= 6; ++i
)
2493 double fLibre
= rDoc
.GetValue(ScAddress(6, i
, 0));
2494 double fExcel
= rDocRes
.GetValue(ScAddress(6, i
, 0));
2495 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2499 void ScOpenCLTest:: testFinacialNPVFormula()
2501 if(!initTestEnv("opencl/financial/NPV.", XLS
, false))
2503 ScDocument
& rDoc
= xDocSh
->GetDocument();
2504 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2507 for (SCROW i
= 0; i
<= 6; ++i
)
2509 double fLibre
= rDoc
.GetValue(ScAddress(6, i
, 0));
2510 double fExcel
= rDocRes
.GetValue(ScAddress(6, i
, 0));
2511 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2515 void ScOpenCLTest:: testFinancialDuration_ADDFormula()
2517 if(!initTestEnv("opencl/financial/Duration_ADD.", XLS
, false))
2519 ScDocument
& rDoc
= xDocSh
->GetDocument();
2520 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2523 for (SCROW i
= 0; i
<= 9; ++i
)
2525 double fLibre
= rDoc
.GetValue(ScAddress(6, i
, 0));
2526 double fExcel
= rDocRes
.GetValue(ScAddress(6, i
, 0));
2527 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2531 void ScOpenCLTest::testStatisticalFormulaNorminv()
2533 if(!initTestEnv("opencl/statistical/Norminv.", XLS
, false))
2535 ScDocument
& rDoc
= xDocSh
->GetDocument();
2536 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2539 // Check the results of formula cells in the shared formula range.
2540 for (SCROW i
= 1; i
<= 19; ++i
)
2542 double fLibre
= rDoc
.GetValue(ScAddress(3,i
,0));
2543 double fExcel
= rDocRes
.GetValue(ScAddress(3,i
,0));
2544 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2548 void ScOpenCLTest::testStatisticalFormulaNormsinv()
2550 if(!initTestEnv("opencl/statistical/Normsinv.", XLS
, false))
2552 ScDocument
& rDoc
= xDocSh
->GetDocument();
2553 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2556 // Check the results of formula cells in the shared formula range.
2557 for (SCROW i
= 1; i
<= 19; ++i
)
2559 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
2560 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
2561 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2565 void ScOpenCLTest::testMathFormulaArcCosHyp()
2567 if(!initTestEnv("opencl/math/ArcCosHyp.", ODS
, false))
2569 ScDocument
& rDoc
= xDocSh
->GetDocument();
2570 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2573 // Verify ACosH Function
2574 for (SCROW i
= 1; i
<= 1000; ++i
)
2576 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
2577 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
2578 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2582 void ScOpenCLTest:: testFinancialMDurationFormula()
2584 if(!initTestEnv("opencl/financial/MDuration.", XLS
, false))
2586 ScDocument
& rDoc
= xDocSh
->GetDocument();
2587 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2590 for (SCROW i
= 0; i
<= 9; ++i
)
2592 double fLibre
= rDoc
.GetValue(ScAddress(6, i
, 0));
2593 double fExcel
= rDocRes
.GetValue(ScAddress(6, i
, 0));
2594 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2598 void ScOpenCLTest::testMathFormulaArcCot()
2600 if(!initTestEnv("opencl/math/ArcCot.", ODS
, false))
2602 ScDocument
& rDoc
= xDocSh
->GetDocument();
2603 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2606 // Verify ACot Function
2607 for (SCROW i
= 1; i
<= 1000; ++i
)
2609 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
2610 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
2611 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2615 void ScOpenCLTest:: testFinancialFVFormula()
2617 if(!initTestEnv("opencl/financial/FV.", XLS
, false))
2619 ScDocument
& rDoc
= xDocSh
->GetDocument();
2620 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2623 for (SCROW i
= 0; i
<= 9; ++i
)
2625 double fLibre
= rDoc
.GetValue(ScAddress(5, i
, 0));
2626 double fExcel
= rDocRes
.GetValue(ScAddress(5, i
, 0));
2627 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2631 void ScOpenCLTest::testFinancialDBFormula()
2633 if(!initTestEnv("opencl/financial/db.", XLS
, false))
2635 ScDocument
& rDoc
= xDocSh
->GetDocument();
2636 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2639 for (SCROW i
= 0; i
<= 9; ++i
)
2641 double fLibre
= rDoc
.GetValue(ScAddress(5, i
, 0));
2642 double fExcel
= rDocRes
.GetValue(ScAddress(5, i
, 0));
2643 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2647 void ScOpenCLTest::testFinancialCouppcdFormula()
2649 if(!initTestEnv("opencl/financial/Couppcd.", XLS
, false))
2651 ScDocument
& rDoc
= xDocSh
->GetDocument();
2652 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2655 for (SCROW i
= 0; i
<= 9; ++i
)
2657 double fLibre
= rDoc
.GetValue(ScAddress(4, i
, 0));
2658 double fExcel
= rDocRes
.GetValue(ScAddress(4, i
, 0));
2659 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2663 void ScOpenCLTest::testMathSumIfsFormula()
2665 if(!initTestEnv("opencl/math/sumifs.", XLS
, false))
2667 ScDocument
& rDoc
= xDocSh
->GetDocument();
2668 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2669 xDocSh
->DoHardRecalc(true);
2671 for (SCROW i
= 2; i
<= 11; ++i
)
2673 double fLibre
= rDoc
.GetValue(ScAddress(5,i
,0));
2674 double fExcel
= rDocRes
.GetValue(ScAddress(5,i
,0));
2675 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2677 for (SCROW i
= 2; i
<= 11; ++i
)
2679 double fLibre
= rDoc
.GetValue(ScAddress(6,i
,0));
2680 double fExcel
= rDocRes
.GetValue(ScAddress(6,i
,0));
2681 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2683 for (SCROW i
= 2; i
<= 11; ++i
)
2685 double fLibre
= rDoc
.GetValue(ScAddress(7,i
,0));
2686 double fExcel
= rDocRes
.GetValue(ScAddress(7,i
,0));
2687 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2689 for (SCROW i
= 2; i
<= 11; ++i
)
2691 double fLibre
= rDoc
.GetValue(ScAddress(8,i
,0));
2692 double fExcel
= rDocRes
.GetValue(ScAddress(8,i
,0));
2693 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2697 void ScOpenCLTest::testMathFormulaArcCotHyp()
2699 if(!initTestEnv("opencl/math/ArcCotHyp.", ODS
, false))
2701 ScDocument
& rDoc
= xDocSh
->GetDocument();
2702 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2705 // Verify ACotH Function
2706 for (SCROW i
= 1; i
<= 1000; ++i
)
2708 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
2709 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
2710 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2714 void ScOpenCLTest::testMathFormulaArcSin()
2716 if(!initTestEnv("opencl/math/ArcSin.", ODS
, false))
2718 ScDocument
& rDoc
= xDocSh
->GetDocument();
2719 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2722 // Verify ACotH Function
2723 for (SCROW i
= 1; i
<= 1000; ++i
)
2725 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
2726 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
2727 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2731 void ScOpenCLTest:: testFinancialVDBFormula()
2733 if(!initTestEnv("opencl/financial/VDB.", XLS
, false))
2735 ScDocument
& rDoc
= xDocSh
->GetDocument();
2736 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2739 for (SCROW i
= 0; i
<= 10; ++i
)
2741 double fLibre
= rDoc
.GetValue(ScAddress(7, i
, 0));
2742 double fExcel
= rDocRes
.GetValue(ScAddress(7, i
, 0));
2743 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2745 for (SCROW i
= 15; i
<= 26; ++i
)
2747 double fLibre
= rDoc
.GetValue(ScAddress(6, i
, 0));
2748 double fExcel
= rDocRes
.GetValue(ScAddress(6, i
, 0));
2749 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2751 for (SCROW i
= 30; i
<= 41; ++i
)
2753 double fLibre
= rDoc
.GetValue(ScAddress(5, i
, 0));
2754 double fExcel
= rDocRes
.GetValue(ScAddress(5, i
, 0));
2755 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2759 void ScOpenCLTest:: testFinancialIPMTFormula()
2761 if(!initTestEnv("opencl/financial/IPMT.", XLS
, false))
2763 ScDocument
& rDoc
= xDocSh
->GetDocument();
2764 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2767 for (SCROW i
= 0; i
<= 9; ++i
)
2769 double fLibre
= rDoc
.GetValue(ScAddress(6, i
, 0));
2770 double fExcel
= rDocRes
.GetValue(ScAddress(6, i
, 0));
2771 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2775 void ScOpenCLTest:: testFinancialXirrFormula()
2777 if(!initTestEnv("opencl/financial/XIRR.", ODS
, false))
2779 ScDocument
& rDoc
= xDocSh
->GetDocument();
2782 for (SCROW i
= 1; i
<= 10; ++i
)
2784 double fFormula
= rDoc
.GetValue(ScAddress(2, i
, 0));
2785 double fExpected
= rDoc
.GetValue(ScAddress(3, i
, 0));
2786 CPPUNIT_ASSERT(rtl::math::approxEqual(fExpected
, fFormula
));
2788 for (SCROW i
= 18; i
<= 27; ++i
)
2790 double fFormula
= rDoc
.GetValue(ScAddress(2, i
, 0));
2791 double fExpected
= rDoc
.GetValue(ScAddress(3, i
, 0));
2792 CPPUNIT_ASSERT(rtl::math::approxEqual(fExpected
, fFormula
));
2798 void ScOpenCLTest::testStatisticalFormulaChiSqDist()
2800 if(!initTestEnv("opencl/statistical/CHISQDIST.", ODS
, false))
2802 ScDocument
& rDoc
= xDocSh
->GetDocument();
2803 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2806 // Check the results of formula cells in the shared formula range.
2807 for (SCROW i
= 1; i
<= 9; ++i
)
2809 double fLibre
= rDoc
.GetValue(ScAddress(2,i
,0));
2810 double fExcel
= rDocRes
.GetValue(ScAddress(2,i
,0));
2811 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2813 for (SCROW i
= 1; i
<= 9; ++i
)
2815 double fLibre
= rDoc
.GetValue(ScAddress(3,i
,0));
2816 double fExcel
= rDocRes
.GetValue(ScAddress(3,i
,0));
2817 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2821 void ScOpenCLTest::testStatisticalFormulaConfidence()
2823 if(!initTestEnv("opencl/statistical/Confidence.", XLS
, false))
2825 ScDocument
& rDoc
= xDocSh
->GetDocument();
2826 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2829 // Check the results of formula cells in the shared formula range.
2830 for (SCROW i
= 0; i
<= 9; ++i
)
2832 double fLibre
= rDoc
.GetValue(ScAddress(3,i
,0));
2833 double fExcel
= rDocRes
.GetValue(ScAddress(3,i
,0));
2834 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2838 void ScOpenCLTest::testStatisticalFormulaFDist()
2840 if(!initTestEnv("opencl/statistical/Fdist.", XLS
, false))
2842 ScDocument
& rDoc
= xDocSh
->GetDocument();
2843 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2846 // Check the results of formula cells in the shared formula range.
2847 for (SCROW i
= 0; i
<= 9; ++i
)
2849 double fLibre
= rDoc
.GetValue(ScAddress(3,i
,0));
2850 double fExcel
= rDocRes
.GetValue(ScAddress(3,i
,0));
2851 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2855 void ScOpenCLTest::testFinancialCoupncdFormula()
2857 if(!initTestEnv("opencl/financial/Coupncd.", XLS
, false))
2859 ScDocument
& rDoc
= xDocSh
->GetDocument();
2860 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2863 for (SCROW i
= 0; i
<= 9; ++i
)
2865 double fLibre
= rDoc
.GetValue(ScAddress(4, i
, 0));
2866 double fExcel
= rDocRes
.GetValue(ScAddress(4, i
, 0));
2867 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2871 void ScOpenCLTest::testFinancialAccrintFormula()
2873 if(!initTestEnv("opencl/financial/Accrint.", XLS
, false))
2875 ScDocument
& rDoc
= xDocSh
->GetDocument();
2876 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2879 for (SCROW i
= 0; i
<= 9; ++i
)
2881 double fLibre
= rDoc
.GetValue(ScAddress(7, i
, 0));
2882 double fExcel
= rDocRes
.GetValue(ScAddress(7, i
, 0));
2883 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2887 void ScOpenCLTest::testStatisticalFormulaCritBinom()
2889 if(!initTestEnv("opencl/statistical/CritBinom.", XLS
, false))
2891 ScDocument
& rDoc
= xDocSh
->GetDocument();
2892 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2895 // Check the results of formula cells in the shared formula range.
2896 for (SCROW i
= 0; i
<= 9; ++i
)
2898 double fLibre
= rDoc
.GetValue(ScAddress(3,i
,0));
2899 double fExcel
= rDocRes
.GetValue(ScAddress(3,i
,0));
2900 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2904 void ScOpenCLTest::testMathFormulaArcSinHyp()
2906 if(!initTestEnv("opencl/math/ArcSinHyp.", ODS
, false))
2908 ScDocument
& rDoc
= xDocSh
->GetDocument();
2909 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2912 // Verify ASinH Function
2913 for (SCROW i
= 1; i
<= 1000; ++i
)
2915 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
2916 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
2917 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2921 void ScOpenCLTest::testMathFormulaArcTan()
2923 if(!initTestEnv("opencl/math/ArcTan.", ODS
, false))
2925 ScDocument
& rDoc
= xDocSh
->GetDocument();
2926 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2929 // Verify ATan Function
2930 for (SCROW i
= 1; i
<= 1000; ++i
)
2932 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
2933 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
2934 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2938 void ScOpenCLTest::testMathFormulaArcTanHyp()
2940 if(!initTestEnv("opencl/math/ArcTanHyp.", ODS
, false))
2942 ScDocument
& rDoc
= xDocSh
->GetDocument();
2943 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2946 // Verify ATanH Function
2947 for (SCROW i
= 1; i
<= 1000; ++i
)
2949 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
2950 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
2951 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2955 void ScOpenCLTest:: testFinacialNPER1Formula()
2957 if(!initTestEnv("opencl/financial/NPER1.", XLS
, false))
2959 ScDocument
& rDoc
= xDocSh
->GetDocument();
2960 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2963 for (SCROW i
= 0; i
<= 6; ++i
)
2965 double fLibre
= rDoc
.GetValue(ScAddress(5, i
, 0));
2966 double fExcel
= rDocRes
.GetValue(ScAddress(5, i
, 0));
2967 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
2971 void ScOpenCLTest::testMathFormulaArcTan2()
2973 if(!initTestEnv("opencl/math/ArcTan2.", ODS
, false))
2975 ScDocument
& rDoc
= xDocSh
->GetDocument();
2976 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2979 // Verify ATan2 Function
2980 for (SCROW i
= 1; i
<= 17; ++i
)
2982 double fLibre
= rDoc
.GetValue(ScAddress(2,i
,0));
2983 double fExcel
= rDocRes
.GetValue(ScAddress(2,i
,0));
2984 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, 0.000001);
2988 void ScOpenCLTest::testStatisticalFormulaChiSqInv()
2990 if(!initTestEnv("opencl/statistical/CHISQINV.", ODS
, false))
2992 ScDocument
& rDoc
= xDocSh
->GetDocument();
2993 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
2996 // Check the results of formula cells in the shared formula range.
2997 for (SCROW i
= 1; i
<= 9; ++i
)
2999 double fLibre
= rDoc
.GetValue(ScAddress(2,i
,0));
3000 double fExcel
= rDocRes
.GetValue(ScAddress(2,i
,0));
3001 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3005 void ScOpenCLTest::testMathFormulaBitAnd()
3007 if(!initTestEnv("opencl/math/BitAnd.", ODS
, false))
3009 ScDocument
& rDoc
= xDocSh
->GetDocument();
3010 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3013 // Verify BitAnd Function
3014 for (SCROW i
= 1; i
<= 1000; ++i
)
3016 double fLibre
= rDoc
.GetValue(ScAddress(2,i
,0));
3017 double fExcel
= rDocRes
.GetValue(ScAddress(2,i
,0));
3018 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3022 void ScOpenCLTest::testStatisticalFormulaPoisson()
3024 if(!initTestEnv("opencl/statistical/Poisson.", XLS
, false))
3026 ScDocument
& rDoc
= xDocSh
->GetDocument();
3027 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3030 // Check the results of formula cells in the shared formula range.
3031 for (SCROW i
= 1; i
<= 19; ++i
)
3033 double fLibre
= rDoc
.GetValue(ScAddress(3,i
,0));
3034 double fExcel
= rDocRes
.GetValue(ScAddress(3,i
,0));
3035 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3039 void ScOpenCLTest::testStatisticalFormulaExpondist()
3041 if(!initTestEnv("opencl/statistical/Expondist.", XLS
, false))
3043 ScDocument
& rDoc
= xDocSh
->GetDocument();
3044 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3047 // Check the results of formula cells in the shared formula range.
3048 for (SCROW i
= 0; i
<= 9; ++i
)
3050 double fLibre
= rDoc
.GetValue(ScAddress(3,i
,0));
3051 double fExcel
= rDocRes
.GetValue(ScAddress(3,i
,0));
3052 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3056 void ScOpenCLTest::testMathFormulaBitOr()
3058 if(!initTestEnv("opencl/math/BitOr.", ODS
, false))
3060 ScDocument
& rDoc
= xDocSh
->GetDocument();
3061 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3064 // Verify BitOr Function
3065 for (SCROW i
= 1; i
<= 20; ++i
)
3067 double fLibre
= rDoc
.GetValue(ScAddress(2,i
,0));
3068 double fExcel
= rDocRes
.GetValue(ScAddress(2,i
,0));
3069 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3073 void ScOpenCLTest::testMathFormulaOdd()
3075 if(!initTestEnv("opencl/math/odd.", XLS
, false))
3077 ScDocument
& rDoc
= xDocSh
->GetDocument();
3078 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3081 for (SCROW i
= 0; i
<= 15; ++i
)
3083 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
3084 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
3085 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3089 void ScOpenCLTest::testMathFormulaLN()
3091 if(!initTestEnv("opencl/math/LN.", XLS
, false))
3093 ScDocument
& rDoc
= xDocSh
->GetDocument();
3094 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3097 // Check the results of formula cells in the shared formula range.
3098 for (SCROW i
= 1; i
<= 9; ++i
)
3100 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
3101 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
3102 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3106 void ScOpenCLTest::testMathFormulaMod()
3108 if(!initTestEnv("opencl/math/mod.", XLS
, false))
3110 ScDocument
& rDoc
= xDocSh
->GetDocument();
3111 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3114 for (SCROW i
= 0; i
<= 15; ++i
)
3116 double fLibre
= rDoc
.GetValue(ScAddress(2,i
,0));
3117 double fExcel
= rDocRes
.GetValue(ScAddress(2,i
,0));
3119 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, 1e-10);
3121 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3125 void ScOpenCLTest::testMathFormulaRound()
3127 if(!initTestEnv("opencl/math/ROUND.", XLS
, false))
3129 ScDocument
& rDoc
= xDocSh
->GetDocument();
3130 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3133 // Check the results of formula cells in the shared formula range.
3134 for (SCROW i
= 1; i
<= 9; ++i
)
3136 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
3137 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
3138 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3140 for (SCROW i
= 15; i
<= 25; ++i
)
3142 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
3143 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
3144 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3148 void ScOpenCLTest::testStatisticalFormulaGammaDist()
3150 if(!initTestEnv("opencl/statistical/GammaDist.", XLS
, false))
3152 ScDocument
& rDoc
= xDocSh
->GetDocument();
3153 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3156 // Check the results of formula cells in the shared formula range.
3157 for (SCROW i
= 1; i
<= 19; ++i
)
3159 double fLibre
= rDoc
.GetValue(ScAddress(4,i
,0));
3160 double fExcel
= rDocRes
.GetValue(ScAddress(4,i
,0));
3161 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3165 void ScOpenCLTest::testStatisticalFormulaGammaInv()
3167 if(!initTestEnv("opencl/statistical/GammaInv.", XLS
, false))
3169 ScDocument
& rDoc
= xDocSh
->GetDocument();
3170 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3173 // Check the results of formula cells in the shared formula range.
3174 for (SCROW i
= 1; i
<= 19; ++i
)
3176 double fLibre
= rDoc
.GetValue(ScAddress(3,i
,0));
3177 double fExcel
= rDocRes
.GetValue(ScAddress(3,i
,0));
3178 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3179 fLibre
= rDoc
.GetValue(ScAddress(4,i
,0));
3180 fExcel
= rDocRes
.GetValue(ScAddress(4,i
,0));
3181 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3185 void ScOpenCLTest::testStatisticalFormulaFInv()
3187 if(!initTestEnv("opencl/statistical/FInv.", XLS
, false))
3189 ScDocument
& rDoc
= xDocSh
->GetDocument();
3190 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3193 // Check the results of formula cells in the shared formula range.
3194 for (SCROW i
= 1; i
<= 19; ++i
)
3196 double fLibre
= rDoc
.GetValue(ScAddress(3,i
,0));
3197 double fExcel
= rDocRes
.GetValue(ScAddress(3,i
,0));
3198 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3199 fLibre
= rDoc
.GetValue(ScAddress(4,i
,0));
3200 fExcel
= rDocRes
.GetValue(ScAddress(4,i
,0));
3201 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3205 void ScOpenCLTest::testStatisticalFormulaFTest()
3207 if(!initTestEnv("opencl/statistical/FTest.", XLS
, false))
3209 ScDocument
& rDoc
= xDocSh
->GetDocument();
3210 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3213 // Check the results of formula cells in the shared formula range.
3214 for (SCROW i
= 1; i
<= 19; ++i
)
3216 double fLibre
= rDoc
.GetValue(ScAddress(2,i
,0));
3217 double fExcel
= rDocRes
.GetValue(ScAddress(2,i
,0));
3218 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3222 void ScOpenCLTest::testStatisticalFormulaB()
3224 if(!initTestEnv("opencl/statistical/B.", XLS
, false))
3226 ScDocument
& rDoc
= xDocSh
->GetDocument();
3227 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3230 // Check the results of formula cells in the shared formula range.
3231 for (SCROW i
= 1; i
<= 19; ++i
)
3233 double fLibre
= rDoc
.GetValue(ScAddress(4,i
,0));
3234 double fExcel
= rDocRes
.GetValue(ScAddress(4,i
,0));
3235 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3236 fLibre
= rDoc
.GetValue(ScAddress(5,i
,0));
3237 fExcel
= rDocRes
.GetValue(ScAddress(5,i
,0));
3238 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3242 void ScOpenCLTest::testStatisticalFormulaBetaDist()
3244 if(!initTestEnv("opencl/statistical/BetaDist.", ODS
, false))
3246 ScDocument
& rDoc
= xDocSh
->GetDocument();
3247 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3250 // Check the results of formula cells in the shared formula range.
3251 for (SCROW i
= 1; i
<= 19; ++i
)
3253 double fLibre
= rDoc
.GetValue(ScAddress(6,i
,0));
3254 double fExcel
= rDocRes
.GetValue(ScAddress(6,i
,0));
3255 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3256 fLibre
= rDoc
.GetValue(ScAddress(7,i
,0));
3257 fExcel
= rDocRes
.GetValue(ScAddress(7,i
,0));
3258 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3262 void ScOpenCLTest::testMathFormulaEven()
3264 if(!initTestEnv("opencl/math/even.", XLS
, false))
3266 ScDocument
& rDoc
= xDocSh
->GetDocument();
3267 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3270 for (SCROW i
= 0; i
<= 15; ++i
)
3272 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
3273 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
3274 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3278 void ScOpenCLTest::testMathFormulaExp()
3280 if(!initTestEnv("opencl/math/exp.", ODS
, false))
3282 ScDocument
& rDoc
= xDocSh
->GetDocument();
3283 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3286 for (SCROW i
= 0; i
<= 15; ++i
)
3288 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
3289 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
3290 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3294 void ScOpenCLTest::testStatisticalFormulaChiDist()
3296 if(!initTestEnv("opencl/statistical/ChiDist.", XLS
, false))
3298 ScDocument
& rDoc
= xDocSh
->GetDocument();
3299 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3302 // Check the results of formula cells in the shared formula range.
3303 for (SCROW i
= 1; i
<= 19; ++i
)
3305 double fLibre
= rDoc
.GetValue(ScAddress(2,i
,0));
3306 double fExcel
= rDocRes
.GetValue(ScAddress(2,i
,0));
3307 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3311 void ScOpenCLTest::testMathFormulaBitLshift()
3313 if(!initTestEnv("opencl/math/BitLshift.", ODS
, false))
3315 ScDocument
& rDoc
= xDocSh
->GetDocument();
3316 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3319 // Verify BitLshift Function
3320 for (SCROW i
= 1; i
<= 20; ++i
)
3322 double fLibre
= rDoc
.GetValue(ScAddress(2,i
,0));
3323 double fExcel
= rDocRes
.GetValue(ScAddress(2,i
,0));
3324 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3328 void ScOpenCLTest::testMathFormulaBitRshift()
3330 if(!initTestEnv("opencl/math/BitRshift.", ODS
, false))
3332 ScDocument
& rDoc
= xDocSh
->GetDocument();
3333 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3336 // Verify BitRshift Function
3337 for (SCROW i
= 1; i
<= 20; ++i
)
3339 double fLibre
= rDoc
.GetValue(ScAddress(2,i
,0));
3340 double fExcel
= rDocRes
.GetValue(ScAddress(2,i
,0));
3341 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3345 void ScOpenCLTest::testMathFormulaFloor()
3347 if(!initTestEnv("opencl/math/floor.", ODS
, false))
3349 ScDocument
& rDoc
= xDocSh
->GetDocument();
3350 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3353 for (SCROW i
= 0; i
<= 9; ++i
)
3355 double fLibre
= rDoc
.GetValue(ScAddress(3,i
,0));
3356 double fExcel
= rDocRes
.GetValue(ScAddress(3,i
,0));
3357 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3361 void ScOpenCLTest::testMathFormulaLog()
3363 if(!initTestEnv("opencl/math/log.", XLS
, false))
3365 ScDocument
& rDoc
= xDocSh
->GetDocument();
3366 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3369 for (SCROW i
= 0; i
<= 47; ++i
)
3371 double fLibre
= rDoc
.GetValue(ScAddress(2,i
,0));
3372 double fExcel
= rDocRes
.GetValue(ScAddress(2,i
,0));
3373 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3377 void ScOpenCLTest::testSpreadSheetFormulaVLookup()
3379 if(!initTestEnv("opencl/spreadsheet/VLookup.", XLS
, false))
3381 ScDocument
& rDoc
= xDocSh
->GetDocument();
3382 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3385 // Check the results of formula cells in the shared formula range.
3386 for (SCROW i
= 1; i
<= 32; ++i
)
3388 double fLibre
= rDoc
.GetValue(ScAddress(5,i
,0));
3389 double fExcel
= rDocRes
.GetValue(ScAddress(5,i
,0));
3390 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3392 for (SCROW i
= 40; i
<= 50; ++i
)
3394 double fLibre
= rDoc
.GetValue(ScAddress(5,i
,0));
3395 double fExcel
= rDocRes
.GetValue(ScAddress(5,i
,0));
3396 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3400 void ScOpenCLTest::testStatisticalFormulaChiInv()
3402 if(!initTestEnv("opencl/statistical/ChiInv.", XLS
, false))
3404 ScDocument
& rDoc
= xDocSh
->GetDocument();
3405 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3408 // Check the results of formula cells in the shared formula range.
3409 for (SCROW i
= 1; i
<= 10; ++i
)
3411 double fLibre
= rDoc
.GetValue(ScAddress(2,i
,0));
3412 double fExcel
= rDocRes
.GetValue(ScAddress(2,i
,0));
3413 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3417 void ScOpenCLTest::testMathFormulaConvert()
3419 if(!initTestEnv("opencl/math/convert.", XLS
, false))
3421 ScDocument
& rDoc
= xDocSh
->GetDocument();
3422 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3425 for (SCROW i
= 0; i
<= 3; ++i
)
3427 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
3428 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
3429 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3433 void ScOpenCLTest::testMathCountIfsFormula()
3435 if(!initTestEnv("opencl/math/countifs.", XLS
, false))
3437 ScDocument
& rDoc
= xDocSh
->GetDocument();
3438 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3439 xDocSh
->DoHardRecalc(true);
3441 for (SCROW i
= 1; i
< 10; ++i
)
3443 double fLibre
= rDoc
.GetValue(ScAddress(4, i
, 0));
3444 double fExcel
= rDocRes
.GetValue(ScAddress(4, i
, 0));
3445 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3449 void ScOpenCLTest::testMathFormulaBitXor()
3451 if(!initTestEnv("opencl/math/BitXor.", ODS
, false))
3453 ScDocument
& rDoc
= xDocSh
->GetDocument();
3454 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3457 // Verify BitXor Function
3458 for (SCROW i
= 1; i
<= 20; ++i
)
3460 double fLibre
= rDoc
.GetValue(ScAddress(2,i
,0));
3461 double fExcel
= rDocRes
.GetValue(ScAddress(2,i
,0));
3462 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3466 void ScOpenCLTest::testMathAverageIfsFormula()
3468 if(!initTestEnv("opencl/math/averageifs.", XLS
, false))
3470 ScDocument
& rDoc
= xDocSh
->GetDocument();
3471 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3473 xDocSh
->DoHardRecalc(true);
3475 for (SCROW i
= 1; i
<= 11; ++i
)
3477 double fLibre
= rDoc
.GetValue(ScAddress(4,i
,0));
3478 double fExcel
= rDocRes
.GetValue(ScAddress(4,i
,0));
3479 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3483 void ScOpenCLTest::testMathFormulaLog10()
3485 if(!initTestEnv("opencl/math/log10.", ODS
, false))
3487 ScDocument
& rDoc
= xDocSh
->GetDocument();
3488 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3491 for (SCROW i
= 0; i
<= 15; ++i
)
3493 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
3494 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
3495 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3499 void ScOpenCLTest::testMathFormulaCombina()
3501 if(!initTestEnv("opencl/math/combina.", XLS
, false))
3503 ScDocument
& rDoc
= xDocSh
->GetDocument();
3504 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3507 for (SCROW i
= 0; i
<= 47; ++i
)
3509 double fLibre
= rDoc
.GetValue(ScAddress(2,i
,0));
3510 double fExcel
= rDocRes
.GetValue(ScAddress(2,i
,0));
3511 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3515 void ScOpenCLTest::testMathFormulaCeil()
3517 if(!initTestEnv("opencl/math/Ceil.", ODS
, false))
3519 ScDocument
& rDoc
= xDocSh
->GetDocument();
3520 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3523 // Verify Ceiling Function
3524 for (SCROW i
= 1; i
<= 20; ++i
)
3526 double fLibre
= rDoc
.GetValue(ScAddress(2,i
,0));
3527 double fExcel
= rDocRes
.GetValue(ScAddress(2,i
,0));
3528 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3532 void ScOpenCLTest::testMathFormulaSqrtPi()
3534 if(!initTestEnv("opencl/math/sqrtpi.", XLS
, false))
3536 ScDocument
& rDoc
= xDocSh
->GetDocument();
3537 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3540 for (SCROW i
= 0; i
< 20; ++i
)
3542 double fLibre
= rDoc
.GetValue(ScAddress(2,i
,0));
3543 double fExcel
= rDocRes
.GetValue(ScAddress(2,i
,0));
3544 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3548 void ScOpenCLTest::testStatisticalFormulaVarP()
3550 if(!initTestEnv("opencl/statistical/VarP.", XLS
, false))
3552 ScDocument
& rDoc
= xDocSh
->GetDocument();
3553 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3556 // Check the results of formula cells in the shared formula range.
3557 for (SCROW i
= 1; i
<= 20; ++i
)
3559 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
3560 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
3561 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3565 void ScOpenCLTest::testStatisticalFormulaStDev()
3567 if(!initTestEnv("opencl/statistical/StDev.", XLS
, false))
3569 ScDocument
& rDoc
= xDocSh
->GetDocument();
3570 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3573 // Check the results of formula cells in the shared formula range.
3574 for (SCROW i
= 1; i
<= 20; ++i
)
3576 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
3577 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
3578 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3582 void ScOpenCLTest::testStatisticalFormulaStDevP()
3584 if(!initTestEnv("opencl/statistical/StDevP.", XLS
, false))
3586 ScDocument
& rDoc
= xDocSh
->GetDocument();
3587 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3590 // Check the results of formula cells in the shared formula range.
3591 for (SCROW i
= 1; i
<= 20; ++i
)
3593 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
3594 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
3595 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3599 void ScOpenCLTest::testStatisticalFormulaSlope()
3601 if(!initTestEnv("opencl/statistical/Slope.", XLS
, false))
3603 ScDocument
& rDoc
= xDocSh
->GetDocument();
3604 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3607 // Check the results of formula cells in the shared formula range.
3608 for (SCROW i
= 1; i
<= 20; ++i
)
3610 double fLibre
= rDoc
.GetValue(ScAddress(2,i
,0));
3611 double fExcel
= rDocRes
.GetValue(ScAddress(2,i
,0));
3612 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3616 void ScOpenCLTest::testStatisticalFormulaSTEYX()
3618 if(!initTestEnv("opencl/statistical/STEYX.", XLS
, false))
3620 ScDocument
& rDoc
= xDocSh
->GetDocument();
3621 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3624 // Check the results of formula cells in the shared formula range.
3625 for (SCROW i
= 1; i
<= 20; ++i
)
3627 double fLibre
= rDoc
.GetValue(ScAddress(2,i
,0));
3628 double fExcel
= rDocRes
.GetValue(ScAddress(2,i
,0));
3629 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3633 void ScOpenCLTest::testStatisticalFormulaZTest()
3635 if(!initTestEnv("opencl/statistical/ZTest.", XLS
, false))
3637 ScDocument
& rDoc
= xDocSh
->GetDocument();
3638 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3641 // Check the results of formula cells in the shared formula range.
3642 for (SCROW i
= 1; i
<= 20; ++i
)
3644 double fLibre
= rDoc
.GetValue(ScAddress(3,i
,0));
3645 double fExcel
= rDocRes
.GetValue(ScAddress(3,i
,0));
3646 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3650 void ScOpenCLTest::testStatisticalFormulaTTest()
3652 if(!initTestEnv("opencl/statistical/TTest.", XLS
, false))
3654 ScDocument
& rDoc
= xDocSh
->GetDocument();
3655 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3658 // Check the results of formula cells in the shared formula range.
3659 for (SCROW i
= 1; i
<= 20; ++i
)
3661 double fLibre
= rDoc
.GetValue(ScAddress(4,i
,0));
3662 double fExcel
= rDocRes
.GetValue(ScAddress(4,i
,0));
3663 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3667 void ScOpenCLTest::testStatisticalFormulaTDist()
3669 if(!initTestEnv("opencl/statistical/TDist.", XLS
, false))
3671 ScDocument
& rDoc
= xDocSh
->GetDocument();
3672 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3675 // Check the results of formula cells in the shared formula range.
3676 for (SCROW i
= 1; i
<= 20; ++i
)
3678 double fLibre
= rDoc
.GetValue(ScAddress(3,i
,0));
3679 double fExcel
= rDocRes
.GetValue(ScAddress(3,i
,0));
3680 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3684 void ScOpenCLTest::testStatisticalFormulaTInv()
3686 if(!initTestEnv("opencl/statistical/TInv.", XLS
, false))
3688 ScDocument
& rDoc
= xDocSh
->GetDocument();
3689 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3692 // Check the results of formula cells in the shared formula range.
3693 for (SCROW i
= 1; i
<= 20; ++i
)
3695 double fLibre
= rDoc
.GetValue(ScAddress(2,i
,0));
3696 double fExcel
= rDocRes
.GetValue(ScAddress(2,i
,0));
3697 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3701 void ScOpenCLTest::testStatisticalFormulaBinomDist()
3703 if(!initTestEnv("opencl/statistical/BinomDist.", XLS
, false))
3705 ScDocument
& rDoc
= xDocSh
->GetDocument();
3706 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3709 // Check the results of formula cells in the shared formula range.
3710 for (SCROW i
= 1; i
<= 9; ++i
)
3712 double fLibre
= rDoc
.GetValue(ScAddress(4,i
,0));
3713 double fExcel
= rDocRes
.GetValue(ScAddress(4,i
,0));
3714 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3718 void ScOpenCLTest::testMathFormulaProduct()
3720 if(!initTestEnv("opencl/math/product.", XLS
, false))
3722 ScDocument
& rDoc
= xDocSh
->GetDocument();
3723 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3726 for (SCROW i
= 0; i
<= 3; ++i
)
3728 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
3729 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
3730 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3734 #if 0 //Disabled temporarily
3735 void ScOpenCLTest::testMathFormulaKombin()
3737 if(!initTestEnv("opencl/math/Kombin.", ODS
, false))
3739 ScDocument
& rDoc
= xDocSh
->GetDocument();
3740 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3743 // Verify Combin Function
3744 for (SCROW i
= 1; i
<= 20; ++i
)
3746 double fLibre
= rDoc
.GetValue(ScAddress(2,i
,0));
3747 double fExcel
= rDocRes
.GetValue(ScAddress(2,i
,0));
3748 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3753 void ScOpenCLTest:: testArrayFormulaSumX2MY2()
3755 if(!initTestEnv("opencl/array/SUMX2MY2.", XLS
, false))
3757 ScDocument
& rDoc
= xDocSh
->GetDocument();
3758 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3761 for (SCROW i
= 0; i
<= 9; ++i
)
3763 double fLibre
= rDoc
.GetValue(ScAddress(2, i
, 0));
3764 double fExcel
= rDocRes
.GetValue(ScAddress(2, i
, 0));
3765 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3767 for (SCROW i
= 20; i
<= 26; ++i
)
3769 double fLibre
= rDoc
.GetValue(ScAddress(2, i
, 0));
3770 double fExcel
= rDocRes
.GetValue(ScAddress(2, i
, 0));
3771 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3775 void ScOpenCLTest::testStatisticalFormulaHypGeomDist()
3777 if(!initTestEnv("opencl/statistical/HypGeomDist.", XLS
, false))
3779 ScDocument
& rDoc
= xDocSh
->GetDocument();
3780 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3783 // Check the results of formula cells in the shared formula range.
3784 for (SCROW i
= 1; i
<= 19; ++i
)
3786 double fLibre
= rDoc
.GetValue(ScAddress(4,i
,0));
3787 double fExcel
= rDocRes
.GetValue(ScAddress(4,i
,0));
3788 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3792 void ScOpenCLTest:: testArrayFormulaSumX2PY2()
3794 if(!initTestEnv("opencl/array/SUMX2PY2.", XLS
, false))
3796 ScDocument
& rDoc
= xDocSh
->GetDocument();
3797 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3800 for (SCROW i
= 0; i
<= 9; ++i
)
3802 double fLibre
= rDoc
.GetValue(ScAddress(2, i
, 0));
3803 double fExcel
= rDocRes
.GetValue(ScAddress(2, i
, 0));
3804 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3806 for (SCROW i
= 20; i
<= 26; ++i
)
3808 double fLibre
= rDoc
.GetValue(ScAddress(2, i
, 0));
3809 double fExcel
= rDocRes
.GetValue(ScAddress(2, i
, 0));
3810 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3814 void ScOpenCLTest::testStatisticalFormulaBetainv()
3816 if(!initTestEnv("opencl/statistical/Betainv.", XLS
, false))
3818 ScDocument
& rDoc
= xDocSh
->GetDocument();
3819 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3822 // Check the results of formula cells in the shared formula range.
3823 for (SCROW i
= 1; i
<= 19; ++i
)
3825 double fLibre
= rDoc
.GetValue(ScAddress(5,i
,0));
3826 double fExcel
= rDocRes
.GetValue(ScAddress(5,i
,0));
3827 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3831 void ScOpenCLTest::testStatisticalFormulaMina()
3833 if(!initTestEnv("opencl/statistical/Mina.", XLS
, false))
3835 ScDocument
& rDoc
= xDocSh
->GetDocument();
3836 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3839 for (SCROW i
= 0; i
<= 9; ++i
)
3841 double fLibre
= rDoc
.GetValue(ScAddress(6, i
, 0));
3842 double fExcel
= rDocRes
.GetValue(ScAddress(6, i
, 0));
3843 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3847 void ScOpenCLTest:: testArrayFormulaSumXMY2()
3849 if(!initTestEnv("opencl/array/SUMXMY2.", XLS
, false))
3851 ScDocument
& rDoc
= xDocSh
->GetDocument();
3852 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3855 for (SCROW i
= 0; i
<= 9; ++i
)
3857 double fLibre
= rDoc
.GetValue(ScAddress(2, i
, 0));
3858 double fExcel
= rDocRes
.GetValue(ScAddress(2, i
, 0));
3859 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3861 for (SCROW i
= 20; i
<= 26; ++i
)
3863 double fLibre
= rDoc
.GetValue(ScAddress(2, i
, 0));
3864 double fExcel
= rDocRes
.GetValue(ScAddress(2, i
, 0));
3865 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3869 void ScOpenCLTest::testStatisticalFormulaCountA()
3871 if(!initTestEnv("opencl/statistical/counta.", XLS
, false))
3873 ScDocument
& rDoc
= xDocSh
->GetDocument();
3874 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3877 for (SCROW i
= 0; i
<= 9; ++i
)
3879 double fLibre
= rDoc
.GetValue(ScAddress(6, i
, 0));
3880 double fExcel
= rDocRes
.GetValue(ScAddress(6, i
, 0));
3881 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3885 void ScOpenCLTest::testStatisticalFormulaMaxa()
3887 if(!initTestEnv("opencl/statistical/Maxa.", XLS
, false))
3889 ScDocument
& rDoc
= xDocSh
->GetDocument();
3890 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3893 for (SCROW i
= 0; i
<= 9; ++i
)
3895 double fLibre
= rDoc
.GetValue(ScAddress(6, i
, 0));
3896 double fExcel
= rDocRes
.GetValue(ScAddress(6, i
, 0));
3897 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3901 void ScOpenCLTest::testMathFormulaSumProduct()
3903 if(!initTestEnv("opencl/math/sumproduct_mixSliding.", XLS
, false))
3905 ScDocument
& rDoc
= xDocSh
->GetDocument();
3906 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3909 // Check the results of formula cells in the shared formula range.
3910 for (SCROW i
= 0; i
<= 9; ++i
)
3912 double fLibre
= rDoc
.GetValue(ScAddress(2,i
,0));
3913 double fExcel
= rDocRes
.GetValue(ScAddress(2,i
,0));
3915 CPPUNIT_ASSERT_DOUBLES_EQUAL(82, fLibre
, fabs(0.0001*fExcel
));
3917 CPPUNIT_ASSERT_DOUBLES_EQUAL(113, fLibre
, fabs(0.0001*fExcel
));
3919 CPPUNIT_ASSERT_DOUBLES_EQUAL(175, fLibre
, fabs(0.0001*fExcel
));
3921 CPPUNIT_ASSERT_DOUBLES_EQUAL(206, fLibre
, fabs(0.0001*fExcel
));
3923 CPPUNIT_ASSERT_DOUBLES_EQUAL(237, fLibre
, fabs(0.0001*fExcel
));
3925 CPPUNIT_ASSERT_DOUBLES_EQUAL(268, fLibre
, fabs(0.0001*fExcel
));
3927 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3931 void ScOpenCLTest::testMathFormulaAverageIf()
3933 if(!initTestEnv("opencl/math/averageif.", XLS
, false))
3935 ScDocument
& rDoc
= xDocSh
->GetDocument();
3936 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3939 for (SCROW i
= 2; i
<= 21; ++i
)
3941 double fLibre
= rDoc
.GetValue(ScAddress(6,i
,0));
3942 double fExcel
= rDocRes
.GetValue(ScAddress(6,i
,0));
3943 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3947 void ScOpenCLTest::testStatisticalFormulaAverageA()
3949 if(!initTestEnv("opencl/statistical/AverageA.", XLS
, false))
3951 ScDocument
& rDoc
= xDocSh
->GetDocument();
3952 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3955 for (SCROW i
= 0; i
<= 9; ++i
)
3957 double fLibre
= rDoc
.GetValue(ScAddress(6, i
, 0));
3958 double fExcel
= rDocRes
.GetValue(ScAddress(6, i
, 0));
3959 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3963 void ScOpenCLTest:: testLogicalFormulaAnd()
3965 if(!initTestEnv("opencl/logical/and.", XLS
, false))
3967 ScDocument
& rDoc
= xDocSh
->GetDocument();
3968 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3971 for (SCROW i
= 1; i
<= 20; ++i
)
3973 double fLibre
= rDoc
.GetValue(ScAddress(2, i
, 0));
3974 double fExcel
= rDocRes
.GetValue(ScAddress(2, i
, 0));
3975 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3977 for (SCROW i
= 1; i
<= 20; ++i
)
3979 double fLibre
= rDoc
.GetValue(ScAddress(3, i
, 0));
3980 double fExcel
= rDocRes
.GetValue(ScAddress(3, i
, 0));
3981 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
3985 void ScOpenCLTest::testStatisticalFormulaVarA()
3987 if(!initTestEnv("opencl/statistical/VarA.", XLS
, false))
3989 ScDocument
& rDoc
= xDocSh
->GetDocument();
3990 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
3993 // Check the results of formula cells in the shared formula range.
3994 for (SCROW i
= 1; i
<= 20; ++i
)
3996 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
3997 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
3998 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
4002 void ScOpenCLTest::testStatisticalFormulaVarPA()
4004 if(!initTestEnv("opencl/statistical/VarPA.", XLS
, false))
4006 ScDocument
& rDoc
= xDocSh
->GetDocument();
4007 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
4009 // Check the results of formula cells in the shared formula range.
4010 for (SCROW i
= 1; i
<= 20; ++i
)
4012 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
4013 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
4014 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
4018 void ScOpenCLTest::testStatisticalFormulaStDevA()
4020 if(!initTestEnv("opencl/statistical/StDevA.", XLS
, false))
4022 ScDocument
& rDoc
= xDocSh
->GetDocument();
4023 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
4026 // Check the results of formula cells in the shared formula range.
4027 for (SCROW i
= 1; i
<= 20; ++i
)
4029 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
4030 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
4031 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
4035 void ScOpenCLTest::testStatisticalFormulaStDevPA()
4037 if(!initTestEnv("opencl/statistical/StDevPA.", XLS
, false))
4039 ScDocument
& rDoc
= xDocSh
->GetDocument();
4040 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
4043 // Check the results of formula cells in the shared formula range.
4044 for (SCROW i
= 1; i
<= 20; ++i
)
4046 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
4047 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
4048 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
4052 void ScOpenCLTest:: testFinancialMDurationFormula1()
4054 if(!initTestEnv("opencl/financial/MDuration1.", XLS
, false))
4056 ScDocument
& rDoc
= xDocSh
->GetDocument();
4057 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
4060 for (SCROW i
= 0; i
<= 9; ++i
)
4062 double fLibre
= rDoc
.GetValue(ScAddress(6, i
, 0));
4063 double fExcel
= rDocRes
.GetValue(ScAddress(6, i
, 0));
4064 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
,fLibre
,fabs(0.00000000001*fExcel
));
4068 void ScOpenCLTest::testMathFormulaSumProduct2()
4070 if(!initTestEnv("opencl/math/sumproductTest.", XLS
, false))
4072 ScDocument
& rDoc
= xDocSh
->GetDocument();
4073 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
4076 // Check the results of formula cells in the shared formula range.
4077 for (SCROW i
= 2; i
<= 12; ++i
)
4079 double fLibre
= rDoc
.GetValue(ScAddress(4,i
,1));
4080 double fExcel
= rDocRes
.GetValue(ScAddress(4,i
,1));
4081 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
4085 void ScOpenCLTest:: testStatisticalParallelCountBug()
4087 if(!initTestEnv("opencl/statistical/parallel_count_bug_243.", ODS
, false))
4089 ScDocument
& rDoc
= xDocSh
->GetDocument();
4090 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
4093 for (SCROW i
= 0; i
< 13; ++i
)
4095 double fLibre
= rDoc
.GetValue(ScAddress(2, i
, 0));
4096 double fExcel
= rDocRes
.GetValue(ScAddress(2, i
, 0));
4097 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
4101 void ScOpenCLTest:: testLogicalFormulaOr()
4103 if(!initTestEnv("opencl/logical/or.", XLS
, false))
4105 ScDocument
& rDoc
= xDocSh
->GetDocument();
4106 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
4109 for (SCROW i
= 0; i
< 20; ++i
)
4111 double fLibre
= rDoc
.GetValue(ScAddress(2, i
, 0));
4112 double fExcel
= rDocRes
.GetValue(ScAddress(2, i
, 0));
4113 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
4117 void ScOpenCLTest:: testLogicalFormulaNot()
4119 if(!initTestEnv("opencl/logical/not.", XLS
, false))
4121 ScDocument
& rDoc
= xDocSh
->GetDocument();
4122 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
4125 for (SCROW i
= 0; i
< 3000; ++i
)
4127 double fLibre
= rDoc
.GetValue(ScAddress(1, i
, 0));
4128 double fExcel
= rDocRes
.GetValue(ScAddress(1, i
, 0));
4129 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
4133 void ScOpenCLTest:: testLogicalFormulaXor()
4135 if(!initTestEnv("opencl/logical/xor.", XLS
, false))
4137 ScDocument
& rDoc
= xDocSh
->GetDocument();
4138 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
4141 for (SCROW i
= 0; i
< 3000; ++i
)
4143 double fLibre
= rDoc
.GetValue(ScAddress(1, i
, 0));
4144 double fExcel
= rDocRes
.GetValue(ScAddress(1, i
, 0));
4145 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
4149 void ScOpenCLTest::testDatabaseFormulaDcount()
4151 if(!initTestEnv("opencl/database/dcount.", XLS
, false))
4153 ScDocument
& rDoc
= xDocSh
->GetDocument();
4154 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
4157 // Check the results of formula cells in the shared formula range.
4158 for (SCROW i
= 1; i
<= 32; ++i
)
4160 double fLibre
= rDoc
.GetValue(ScAddress(9,i
,0));
4161 double fExcel
= rDocRes
.GetValue(ScAddress(10,i
,0));
4162 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.00000000001));
4166 void ScOpenCLTest::testDatabaseFormulaDcountA()
4168 if(!initTestEnv("opencl/database/dcountA.", XLS
, false))
4170 ScDocument
& rDoc
= xDocSh
->GetDocument();
4171 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
4174 // Check the results of formula cells in the shared formula range.
4175 for (SCROW i
= 1; i
<= 32; ++i
)
4177 double fLibre
= rDoc
.GetValue(ScAddress(9,i
,0));
4178 double fExcel
= rDocRes
.GetValue(ScAddress(10,i
,0));
4179 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.00000000001));
4183 void ScOpenCLTest::testDatabaseFormulaDmax()
4185 if(!initTestEnv("opencl/database/dmax.", XLS
, false))
4187 ScDocument
& rDoc
= xDocSh
->GetDocument();
4188 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
4191 // Check the results of formula cells in the shared formula range.
4192 for (SCROW i
= 1; i
<= 32; ++i
)
4194 double fLibre
= rDoc
.GetValue(ScAddress(9,i
,0));
4195 double fExcel
= rDocRes
.GetValue(ScAddress(10,i
,0));
4196 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.00000000001));
4200 void ScOpenCLTest::testDatabaseFormulaDmin()
4202 if(!initTestEnv("opencl/database/dmin.", XLS
, false))
4204 ScDocument
& rDoc
= xDocSh
->GetDocument();
4205 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
4208 // Check the results of formula cells in the shared formula range.
4209 for (SCROW i
= 1; i
<= 32; ++i
)
4211 double fLibre
= rDoc
.GetValue(ScAddress(9,i
,0));
4212 double fExcel
= rDocRes
.GetValue(ScAddress(10,i
,0));
4213 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.00000000001));
4217 void ScOpenCLTest::testDatabaseFormulaDproduct()
4219 if(!initTestEnv("opencl/database/dproduct.", XLS
, false))
4221 ScDocument
& rDoc
= xDocSh
->GetDocument();
4222 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
4225 // Check the results of formula cells in the shared formula range.
4226 for (SCROW i
= 1; i
<= 32; ++i
)
4228 double fLibre
= rDoc
.GetValue(ScAddress(9,i
,0));
4229 double fExcel
= rDocRes
.GetValue(ScAddress(10,i
,0));
4230 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.00000000001));
4234 void ScOpenCLTest::testDatabaseFormulaDaverage()
4236 if(!initTestEnv("opencl/database/daverage.", XLS
, false))
4238 ScDocument
& rDoc
= xDocSh
->GetDocument();
4239 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
4242 // Check the results of formula cells in the shared formula range.
4243 for (SCROW i
= 1; i
<= 32; ++i
)
4245 double fLibre
= rDoc
.GetValue(ScAddress(9,i
,0));
4246 double fExcel
= rDocRes
.GetValue(ScAddress(10,i
,0));
4247 //CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
4248 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.00000000001));
4252 void ScOpenCLTest::testDatabaseFormulaDstdev()
4254 if(!initTestEnv("opencl/database/dstdev.", XLS
, false))
4256 ScDocument
& rDoc
= xDocSh
->GetDocument();
4257 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
4260 // Check the results of formula cells in the shared formula range.
4261 for (SCROW i
= 1; i
<= 32; ++i
)
4263 double fLibre
= rDoc
.GetValue(ScAddress(9,i
,0));
4264 double fExcel
= rDocRes
.GetValue(ScAddress(10,i
,0));
4265 //CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
4266 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.00000000001));
4270 void ScOpenCLTest::testDatabaseFormulaDstdevp()
4272 if(!initTestEnv("opencl/database/dstdevp.", XLS
, false))
4274 ScDocument
& rDoc
= xDocSh
->GetDocument();
4275 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
4278 // Check the results of formula cells in the shared formula range.
4279 for (SCROW i
= 1; i
<= 32; ++i
)
4281 double fLibre
= rDoc
.GetValue(ScAddress(9,i
,0));
4282 double fExcel
= rDocRes
.GetValue(ScAddress(10,i
,0));
4283 //CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
4284 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.00000000001));
4288 void ScOpenCLTest::testDatabaseFormulaDsum()
4290 if(!initTestEnv("opencl/database/dsum.", XLS
, false))
4292 ScDocument
& rDoc
= xDocSh
->GetDocument();
4293 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
4296 // Check the results of formula cells in the shared formula range.
4297 for (SCROW i
= 1; i
<= 32; ++i
)
4299 double fLibre
= rDoc
.GetValue(ScAddress(9,i
,0));
4300 double fExcel
= rDocRes
.GetValue(ScAddress(10,i
,0));
4301 //CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
4302 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.00000000001));
4306 void ScOpenCLTest::testDatabaseFormulaDvar()
4308 if(!initTestEnv("opencl/database/dvar.", XLS
, false))
4310 ScDocument
& rDoc
= xDocSh
->GetDocument();
4311 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
4314 // Check the results of formula cells in the shared formula range.
4315 for (SCROW i
= 1; i
<= 32; ++i
)
4317 double fLibre
= rDoc
.GetValue(ScAddress(9,i
,0));
4318 double fExcel
= rDocRes
.GetValue(ScAddress(10,i
,0));
4319 //CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
4320 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.00000000001));
4324 void ScOpenCLTest::testDatabaseFormulaDvarp()
4326 if(!initTestEnv("opencl/database/dvarp.", XLS
, false))
4328 ScDocument
& rDoc
= xDocSh
->GetDocument();
4329 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
4332 // Check the results of formula cells in the shared formula range.
4333 for (SCROW i
= 1; i
<= 32; ++i
)
4335 double fLibre
= rDoc
.GetValue(ScAddress(9,i
,0));
4336 double fExcel
= rDocRes
.GetValue(ScAddress(10,i
,0));
4337 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.00000000001));
4341 void ScOpenCLTest::testMathFormulaRoundUp()
4343 if(!initTestEnv("opencl/math/roundup.", XLS
, false))
4345 ScDocument
& rDoc
= xDocSh
->GetDocument();
4346 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
4349 // Check the results of formula cells in the shared formula range.
4350 for (SCROW i
= 1; i
<= 9; ++i
)
4352 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
4353 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
4354 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
4358 void ScOpenCLTest::testMathFormulaRoundDown()
4360 if(!initTestEnv("opencl/math/rounddown.", XLS
, false))
4362 ScDocument
& rDoc
= xDocSh
->GetDocument();
4363 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
4366 // Check the results of formula cells in the shared formula range.
4367 for (SCROW i
= 1; i
<= 9; ++i
)
4369 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
4370 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
4371 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
4375 void ScOpenCLTest::testMathFormulaInt()
4377 if(!initTestEnv("opencl/math/int.", XLS
, false))
4379 ScDocument
& rDoc
= xDocSh
->GetDocument();
4380 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
4383 // Check the results of formula cells in the shared formula range.
4384 for (SCROW i
= 1; i
<= 9; ++i
)
4386 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
4387 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
4388 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
4392 void ScOpenCLTest::testMathFormulaRadians()
4394 if(!initTestEnv("opencl/math/radians.", XLS
, false))
4396 ScDocument
& rDoc
= xDocSh
->GetDocument();
4397 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
4400 // Check the results of formula cells in the shared formula range.
4401 for (SCROW i
= 1; i
<= 9; ++i
)
4403 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
4404 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
4405 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
4409 void ScOpenCLTest::testMathFormulaDegrees()
4411 if(!initTestEnv("opencl/math/degrees.", XLS
, false))
4413 ScDocument
& rDoc
= xDocSh
->GetDocument();
4414 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
4417 for (SCROW i
= 0; i
<= 200; ++i
)
4419 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
4420 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
4421 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
4425 void ScOpenCLTest::testMathFormulaIsEven()
4427 if(!initTestEnv("opencl/math/iseven.", XLS
, false))
4429 ScDocument
& rDoc
= xDocSh
->GetDocument();
4430 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
4433 // Check the results of formula cells in the shared formula range.
4434 for (SCROW i
= 1; i
<= 9; ++i
)
4436 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
4437 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
4438 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
4442 void ScOpenCLTest::testMathFormulaCountIf()
4444 if(!initTestEnv("opencl/math/countif.", XLS
, false))
4446 ScDocument
& rDoc
= xDocSh
->GetDocument();
4447 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
4450 for (SCROW i
= 0; i
<= 26; ++i
)
4452 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
4453 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
4454 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
4458 void ScOpenCLTest::testMathFormulaIsOdd()
4460 if(!initTestEnv("opencl/math/isodd.", XLS
, false))
4462 ScDocument
& rDoc
= xDocSh
->GetDocument();
4463 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
4466 // Check the results of formula cells in the shared formula range.
4467 for (SCROW i
= 1; i
<= 9; ++i
)
4469 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
4470 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
4471 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
4475 void ScOpenCLTest::testMathFormulaFact()
4477 if(!initTestEnv("opencl/math/fact.", XLS
, false))
4479 ScDocument
& rDoc
= xDocSh
->GetDocument();
4480 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
4483 for (SCROW i
= 0; i
<= 18; ++i
)
4485 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
4486 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
4487 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
4491 void ScOpenCLTest::testMathFormulaSEC()
4493 if(!initTestEnv("opencl/math/sec.", ODS
, false))
4495 ScDocument
& rDoc
= xDocSh
->GetDocument();
4496 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
4499 for (SCROW i
= 0; i
<= 15; ++i
)
4501 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
4502 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
4503 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
4507 void ScOpenCLTest::testMathFormulaSECH()
4509 if(!initTestEnv("opencl/math/sech.", ODS
, false))
4511 ScDocument
& rDoc
= xDocSh
->GetDocument();
4512 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
4515 for (SCROW i
= 0; i
<= 15; ++i
)
4517 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
4518 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
4519 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
4523 void ScOpenCLTest::testMathFormulaMROUND()
4525 if(!initTestEnv("opencl/math/MROUND.", XLS
, false))
4527 ScDocument
& rDoc
= xDocSh
->GetDocument();
4528 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
4531 for (SCROW i
= 0; i
<= 13; ++i
)
4533 double fLibre
= rDoc
.GetValue(ScAddress(2,i
,0));
4534 double fExcel
= rDocRes
.GetValue(ScAddress(2,i
,0));
4535 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
4539 void ScOpenCLTest::testMathFormulaQuotient()
4541 if(!initTestEnv("opencl/math/Quotient.", ODS
, false))
4543 ScDocument
& rDoc
= xDocSh
->GetDocument();
4544 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
4547 // Verify BitAnd Function
4548 for (SCROW i
= 1; i
<= 20; ++i
)
4550 double fLibre
= rDoc
.GetValue(ScAddress(2,i
,0));
4551 double fExcel
= rDocRes
.GetValue(ScAddress(2,i
,0));
4552 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
4556 void ScOpenCLTest::testMathFormulaSeriesSum()
4558 if(!initTestEnv("opencl/math/seriessum.", XLS
, false))
4560 ScDocument
& rDoc
= xDocSh
->GetDocument();
4561 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
4564 for (SCROW i
= 0; i
<= 15; ++i
)
4566 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
4567 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
4568 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
4572 void ScOpenCLTest::testMathFormulaSumIf()
4574 if(!initTestEnv("opencl/math/sumif.", XLS
, false))
4576 ScDocument
& rDoc
= xDocSh
->GetDocument();
4577 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
4580 for (SCROW i
= 0; i
<= 26; ++i
)
4582 double fLibre
= rDoc
.GetValue(ScAddress(2,i
,0));
4583 double fExcel
= rDocRes
.GetValue(ScAddress(2,i
,0));
4584 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
4588 void ScOpenCLTest::testAddInFormulaBesseLJ()
4590 if(!initTestEnv("opencl/addin/besselj.", XLS
, false))
4592 ScDocument
& rDoc
= xDocSh
->GetDocument();
4593 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
4596 // Check the results of formula cells in the shared formula range.
4597 for (SCROW i
= 1; i
<= 20; ++i
)
4599 double fLibre
= rDoc
.GetValue(ScAddress(2,i
,0));
4600 double fExcel
= rDocRes
.GetValue(ScAddress(2,i
,0));
4601 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
4605 void ScOpenCLTest::testStatisticalFormulaAvedev()
4607 if(!initTestEnv("opencl/statistical/Avedev.", XLS
, false))
4609 ScDocument
& rDoc
= xDocSh
->GetDocument();
4610 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
4613 // Check the results of formula cells in the shared formula range.
4614 for (SCROW i
= 1; i
<= 19; ++i
)
4616 double fLibre
= rDoc
.GetValue(ScAddress(3,i
,0));
4617 double fExcel
= rDocRes
.GetValue(ScAddress(3,i
,0));
4618 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
4622 void ScOpenCLTest::testNegSub()
4624 if(!initTestEnv("opencl/math/NegSub.", XLS
, false))
4626 ScDocument
& rDoc
= xDocSh
->GetDocument();
4627 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
4630 // Check the results of formula cells in the shared formula range.
4631 for (SCROW i
= 0; i
<= 9; ++i
)
4633 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
4634 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
4635 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
4639 void ScOpenCLTest::testMathFormulaAverageIf_Mix()
4641 if(!initTestEnv("opencl/math/averageif_mix.", XLS
, false))
4643 ScDocument
& rDoc
= xDocSh
->GetDocument();
4644 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
4647 for (SCROW i
= 0; i
<= 9; ++i
)
4649 double fLibre
= rDoc
.GetValue(ScAddress(2,i
,0));
4650 double fExcel
= rDocRes
.GetValue(ScAddress(2,i
,0));
4651 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
4655 void ScOpenCLTest::testStatisticalFormulaKurt1()
4657 if(!initTestEnv("opencl/statistical/Kurt1.", XLS
, false))
4659 ScDocument
& rDoc
= xDocSh
->GetDocument();
4660 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
4663 // Check the results of formula cells in the shared formula range.
4664 for (SCROW i
= 1; i
<= 19; ++i
)
4666 double fLibre
= rDoc
.GetValue(ScAddress(2,i
,0));
4667 double fExcel
= rDocRes
.GetValue(ScAddress(2,i
,0));
4668 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
4672 void ScOpenCLTest::testStatisticalFormulaHarMean1()
4674 if(!initTestEnv("opencl/statistical/HarMean1.", XLS
, false))
4676 ScDocument
& rDoc
= xDocSh
->GetDocument();
4677 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
4680 // Check the results of formula cells in the shared formula range.
4681 for (SCROW i
= 1; i
<= 19; ++i
)
4683 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
4684 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
4685 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
4689 void ScOpenCLTest::testStatisticalFormulaVarA1()
4691 if(!initTestEnv("opencl/statistical/VarA1.", XLS
, false))
4693 ScDocument
& rDoc
= xDocSh
->GetDocument();
4694 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
4697 // Check the results of formula cells in the shared formula range.
4698 for (SCROW i
= 1; i
<= 20; ++i
)
4700 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
4701 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
4702 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
4706 void ScOpenCLTest::testStatisticalFormulaVarPA1()
4708 if(!initTestEnv("opencl/statistical/VarPA1.", XLS
, false))
4710 ScDocument
& rDoc
= xDocSh
->GetDocument();
4711 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
4714 // Check the results of formula cells in the shared formula range.
4715 for (SCROW i
= 1; i
<= 20; ++i
)
4717 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
4718 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
4719 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
4723 void ScOpenCLTest::testStatisticalFormulaStDevA1()
4725 if(!initTestEnv("opencl/statistical/StDevA1.", XLS
, false))
4727 ScDocument
& rDoc
= xDocSh
->GetDocument();
4728 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
4731 // Check the results of formula cells in the shared formula range.
4732 for (SCROW i
= 1; i
<= 20; ++i
)
4734 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
4735 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
4736 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
4740 void ScOpenCLTest::testStatisticalFormulaStDevPA1()
4742 if(!initTestEnv("opencl/statistical/StDevPA1.", XLS
, false))
4744 ScDocument
& rDoc
= xDocSh
->GetDocument();
4745 ScDocument
& rDocRes
= xDocShRes
->GetDocument();
4748 // Check the results of formula cells in the shared formula range.
4749 for (SCROW i
= 1; i
<= 20; ++i
)
4751 double fLibre
= rDoc
.GetValue(ScAddress(1,i
,0));
4752 double fExcel
= rDocRes
.GetValue(ScAddress(1,i
,0));
4753 CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel
, fLibre
, fabs(0.0001*fExcel
));
4757 ScOpenCLTest::ScOpenCLTest()
4758 : ScBootstrapFixture( "/sc/qa/unit/data" )
4762 void ScOpenCLTest::setUp()
4764 test::BootstrapFixture::setUp();
4765 // This is a bit of a fudge, we do this to ensure that ScGlobals::ensure,
4766 // which is a private symbol to us, gets called
4768 getMultiServiceFactory()->
4769 createInstance("com.sun.star.comp.Calc.SpreadsheetDocument");
4770 CPPUNIT_ASSERT_MESSAGE("no calc component!", m_xCalcComponent
.is());
4773 void ScOpenCLTest::tearDown()
4779 xDocShRes
->DoClose();
4781 uno::Reference
< lang::XComponent
>
4782 ( m_xCalcComponent
, UNO_QUERY_THROW
)->dispose();
4783 test::BootstrapFixture::tearDown();
4786 CPPUNIT_TEST_SUITE_REGISTRATION(ScOpenCLTest
);
4788 CPPUNIT_PLUGIN_IMPLEMENT();
4790 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */