You've already forked lazarus-ccr
fpspreadsheet: loose precision tests for FPC trunk floating point values
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3338 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -372,7 +372,12 @@ var
|
|||||||
ActualDateTime: TDateTime;
|
ActualDateTime: TDateTime;
|
||||||
ErrorMargin: TDateTime; //margin for error in comparison test
|
ErrorMargin: TDateTime; //margin for error in comparison test
|
||||||
begin
|
begin
|
||||||
|
// Seems to be needed for testing with FPC 2.7.x; 2.6.4 shows more precise comparison
|
||||||
|
{$if FPC_FULLVERSION>=20701}
|
||||||
ErrorMargin := 1E-5/(24*60*60*1000); // = 10 nsec = 1E-8 sec (1 ns fails)
|
ErrorMargin := 1E-5/(24*60*60*1000); // = 10 nsec = 1E-8 sec (1 ns fails)
|
||||||
|
{$else}
|
||||||
|
ErrorMargin:=0;
|
||||||
|
{$endif}
|
||||||
if Row>High(SollDates) then
|
if Row>High(SollDates) then
|
||||||
fail('Error in test code: array bounds overflow. Check array size is correct.');
|
fail('Error in test code: array bounds overflow. Check array size is correct.');
|
||||||
|
|
||||||
|
@ -155,7 +155,20 @@ var
|
|||||||
s: String;
|
s: String;
|
||||||
t: TTime;
|
t: TTime;
|
||||||
hr,min,sec,msec: Word;
|
hr,min,sec,msec: Word;
|
||||||
|
ErrorMargin: double;
|
||||||
begin
|
begin
|
||||||
|
// Seems to be needed for testing with FPC 2.7.x; 2.6.4 shows more precise comparison
|
||||||
|
{$if FPC_FULLVERSION>=20701}
|
||||||
|
ErrorMargin:=1.44E-7;
|
||||||
|
//1.44E-7 for SUMSQ formula
|
||||||
|
//6.0E-8 for SUM formula
|
||||||
|
//4.8E-8 for MAX formula
|
||||||
|
//2.4E-8 for now formula
|
||||||
|
//about 1E-15 is needed for some trig functions
|
||||||
|
{$else}
|
||||||
|
ErrorMargin:=0;
|
||||||
|
{$endif}
|
||||||
|
|
||||||
// Create test workbook
|
// Create test workbook
|
||||||
MyWorkbook := TsWorkbook.Create;
|
MyWorkbook := TsWorkbook.Create;
|
||||||
MyWorkSheet:= MyWorkBook.AddWorksheet(SHEET);
|
MyWorkSheet:= MyWorkBook.AddWorksheet(SHEET);
|
||||||
@ -206,7 +219,7 @@ begin
|
|||||||
'Test read calculated formula result mismatch, formula "' + formula +
|
'Test read calculated formula result mismatch, formula "' + formula +
|
||||||
'", cell '+CellNotation(MyWorkSheet,Row,1));
|
'", cell '+CellNotation(MyWorkSheet,Row,1));
|
||||||
atNumber:
|
atNumber:
|
||||||
CheckEquals(expected.NumberValue, actual.NumberValue,
|
CheckEquals(expected.NumberValue, actual.NumberValue, ErrorMargin,
|
||||||
'Test read calculated formula result mismatch, formula "' + formula +
|
'Test read calculated formula result mismatch, formula "' + formula +
|
||||||
'", cell '+CellNotation(MyWorkSheet,Row,1));
|
'", cell '+CellNotation(MyWorkSheet,Row,1));
|
||||||
atString:
|
atString:
|
||||||
|
Reference in New Issue
Block a user