2014-05-24 20:28:05 +00:00
|
|
|
unit formulatests;
|
|
|
|
|
|
|
|
{$mode objfpc}{$H+}
|
|
|
|
|
2014-06-28 19:40:28 +00:00
|
|
|
{ Deactivate this define in order to bypass tests which will raise an exception
|
|
|
|
when the corresponding rpn formula is calculated. }
|
|
|
|
{.$DEFINE ENABLE_CALC_RPN_EXCEPTIONS}
|
|
|
|
|
2014-07-01 12:55:02 +00:00
|
|
|
{ Deactivate this define to include errors in the structure of the rpn formulas.
|
|
|
|
Note that Excel report a corrupted file when trying to read this file }
|
|
|
|
{.DEFINE ENABLE_DEFECTIVE_FORMULAS }
|
|
|
|
|
2014-06-28 19:40:28 +00:00
|
|
|
|
2014-05-24 20:28:05 +00:00
|
|
|
interface
|
|
|
|
|
|
|
|
uses
|
|
|
|
// Not using Lazarus package as the user may be working with multiple versions
|
|
|
|
// Instead, add .. to unit search path
|
|
|
|
Classes, SysUtils, fpcunit, testutils, testregistry,
|
2014-08-30 18:03:22 +00:00
|
|
|
fpsallformats, fpspreadsheet, fpsexprparser,
|
2014-06-28 19:40:28 +00:00
|
|
|
xlsbiff8 {and a project requirement for lclbase for utf8 handling},
|
2014-05-24 20:28:05 +00:00
|
|
|
testsutility;
|
|
|
|
|
|
|
|
type
|
|
|
|
{ TSpreadWriteReadFormula }
|
|
|
|
//Write to xls/xml file and read back
|
|
|
|
TSpreadWriteReadFormulaTests = class(TTestCase)
|
|
|
|
private
|
|
|
|
protected
|
|
|
|
// Set up expected values:
|
|
|
|
procedure SetUp; override;
|
|
|
|
procedure TearDown; override;
|
|
|
|
// Test formula strings
|
2014-08-30 18:03:22 +00:00
|
|
|
procedure TestWriteReadFormulaStrings(AFormat: TsSpreadsheetFormat;
|
|
|
|
UseRPNFormula: Boolean);
|
2014-06-28 19:40:28 +00:00
|
|
|
// Test calculation of rpn formulas
|
2014-08-30 18:03:22 +00:00
|
|
|
procedure TestCalcFormulas(AFormat: TsSpreadsheetformat; UseRPNFormula: Boolean);
|
2014-05-24 20:28:05 +00:00
|
|
|
|
|
|
|
published
|
|
|
|
// Writes out numbers & reads back.
|
|
|
|
// If previous read tests are ok, this effectively tests writing.
|
2014-05-25 16:49:45 +00:00
|
|
|
{ BIFF2 Tests }
|
2014-08-30 18:03:22 +00:00
|
|
|
procedure Test_Write_Read_FormulaStrings_BIFF2;
|
2014-05-25 16:49:45 +00:00
|
|
|
{ BIFF5 Tests }
|
2014-08-30 18:03:22 +00:00
|
|
|
procedure Test_Write_Read_FormulaStrings_BIFF5;
|
2014-05-24 20:28:05 +00:00
|
|
|
{ BIFF8 Tests }
|
2014-08-30 18:03:22 +00:00
|
|
|
procedure Test_Write_Read_FormulaStrings_BIFF8;
|
|
|
|
{ OOXML Tests }
|
|
|
|
procedure Test_Write_Read_FormulaStrings_OOXML;
|
2014-09-01 13:21:39 +00:00
|
|
|
{ ODS Tests }
|
|
|
|
procedure Test_Write_Read_FormulaStrings_ODS;
|
2014-06-28 19:40:28 +00:00
|
|
|
|
2014-08-30 18:03:22 +00:00
|
|
|
// Writes out and calculates rpn formulas, read back
|
2014-07-01 22:47:10 +00:00
|
|
|
{ BIFF2 Tests }
|
2014-08-30 18:03:22 +00:00
|
|
|
procedure Test_Write_Read_CalcRPNFormula_BIFF2;
|
2014-07-01 22:47:10 +00:00
|
|
|
{ BIFF5 Tests }
|
2014-08-30 18:03:22 +00:00
|
|
|
procedure Test_Write_Read_CalcRPNFormula_BIFF5;
|
2014-06-28 19:40:28 +00:00
|
|
|
{ BIFF8 Tests }
|
2014-08-30 18:03:22 +00:00
|
|
|
procedure Test_Write_Read_CalcRPNFormula_BIFF8;
|
|
|
|
{ OOXML Tests }
|
|
|
|
procedure Test_Write_Read_CalcRPNFormula_OOXML;
|
2014-09-02 09:25:54 +00:00
|
|
|
{ ODSL Tests }
|
|
|
|
procedure Test_Write_Read_CalcRPNFormula_ODS;
|
2014-08-30 18:03:22 +00:00
|
|
|
|
|
|
|
// Writes out and calculates string formulas, read back
|
|
|
|
{ BIFF2 Tests }
|
|
|
|
procedure Test_Write_Read_CalcStringFormula_BIFF2;
|
|
|
|
{ BIFF5 Tests }
|
|
|
|
procedure Test_Write_Read_CalcStringFormula_BIFF5;
|
|
|
|
{ BIFF8 Tests }
|
|
|
|
procedure Test_Write_Read_CalcStringFormula_BIFF8;
|
|
|
|
{ OOXML Tests }
|
|
|
|
procedure Test_Write_Read_CalcStringFormula_OOXML;
|
2014-09-02 09:25:54 +00:00
|
|
|
{ ODS Tests }
|
|
|
|
procedure Test_Write_Read_CalcStringFormula_ODS;
|
2014-05-24 20:28:05 +00:00
|
|
|
end;
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
uses
|
2014-06-30 22:30:23 +00:00
|
|
|
math, typinfo, lazUTF8, fpsUtils, rpnFormulaUnit;
|
2014-05-24 20:28:05 +00:00
|
|
|
|
2014-08-30 18:03:22 +00:00
|
|
|
var
|
|
|
|
// Array containing the "true" results of the formulas, for comparison
|
|
|
|
SollValues: array of TsExpressionResult;
|
|
|
|
|
|
|
|
// Helper for statistics tests
|
|
|
|
const
|
|
|
|
STATS_NUMBERS: Array[0..4] of Double = (1.0, 1.1, 1.2, 0.9, 0.8);
|
|
|
|
var
|
|
|
|
numberArray: array[0..4] of Double;
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-05-24 20:28:05 +00:00
|
|
|
{ TSpreadWriteReadFormatTests }
|
|
|
|
|
|
|
|
procedure TSpreadWriteReadFormulaTests.SetUp;
|
|
|
|
begin
|
|
|
|
inherited SetUp;
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TSpreadWriteReadFormulaTests.TearDown;
|
|
|
|
begin
|
|
|
|
inherited TearDown;
|
|
|
|
end;
|
|
|
|
|
2014-08-30 18:03:22 +00:00
|
|
|
procedure TSpreadWriteReadFormulaTests.TestWriteReadFormulaStrings(
|
|
|
|
AFormat: TsSpreadsheetFormat; UseRPNFormula: Boolean);
|
|
|
|
{ If UseRPNFormula is true the test formulas are generated from RPN formulas.
|
|
|
|
Otherwise they are generated from string formulas. }
|
2014-05-24 20:28:05 +00:00
|
|
|
const
|
|
|
|
SHEET = 'Sheet1';
|
|
|
|
var
|
|
|
|
MyWorksheet: TsWorksheet;
|
|
|
|
MyWorkbook: TsWorkbook;
|
2014-06-19 19:25:40 +00:00
|
|
|
Row: Integer;
|
2014-05-24 20:28:05 +00:00
|
|
|
TempFile: string; //write xls/xml to this file and read back from it
|
2014-08-30 18:03:22 +00:00
|
|
|
formula: String;
|
2014-05-24 20:28:05 +00:00
|
|
|
expected: String;
|
|
|
|
actual: String;
|
|
|
|
cell: PCell;
|
2014-08-30 18:03:22 +00:00
|
|
|
cellB1: Double;
|
|
|
|
cellB2: Double;
|
|
|
|
number: Double;
|
|
|
|
s: String;
|
|
|
|
hr, min, sec, msec: Word;
|
|
|
|
k: Integer;
|
2014-05-24 20:28:05 +00:00
|
|
|
begin
|
|
|
|
TempFile := GetTempFileName;
|
|
|
|
|
|
|
|
// Create test workbook
|
|
|
|
MyWorkbook := TsWorkbook.Create;
|
2014-08-03 21:21:31 +00:00
|
|
|
try
|
2014-08-30 18:03:22 +00:00
|
|
|
MyWorkbook.Options := MyWorkbook.Options + [boCalcBeforeSaving];
|
2014-08-03 21:21:31 +00:00
|
|
|
MyWorkSheet:= MyWorkBook.AddWorksheet(SHEET);
|
|
|
|
|
|
|
|
// Write out all test formulas
|
|
|
|
// All formulas are in column B
|
2014-08-30 18:03:22 +00:00
|
|
|
{$I testcases_calcrpnformula.inc}
|
|
|
|
// WriteRPNFormulaSamples(MyWorksheet, AFormat, true, UseRPNFormula);
|
2014-08-03 21:21:31 +00:00
|
|
|
MyWorkBook.WriteToFile(TempFile, AFormat, true);
|
|
|
|
finally
|
|
|
|
MyWorkbook.Free;
|
|
|
|
end;
|
2014-05-24 20:28:05 +00:00
|
|
|
|
|
|
|
// Open the spreadsheet
|
|
|
|
MyWorkbook := TsWorkbook.Create;
|
2014-08-03 21:21:31 +00:00
|
|
|
try
|
2014-08-29 15:32:43 +00:00
|
|
|
MyWorkbook.Options := MyWorkbook.Options + [boReadFormulas];
|
2014-08-03 21:21:31 +00:00
|
|
|
|
|
|
|
MyWorkbook.ReadFromFile(TempFile, AFormat);
|
|
|
|
if AFormat = sfExcel2 then
|
|
|
|
MyWorksheet := MyWorkbook.GetFirstWorksheet
|
|
|
|
else
|
|
|
|
MyWorksheet := GetWorksheetByName(MyWorkBook, SHEET);
|
|
|
|
if MyWorksheet=nil then
|
|
|
|
fail('Error in test code. Failed to get named worksheet');
|
|
|
|
for Row := 0 to MyWorksheet.GetLastRowIndex do
|
|
|
|
begin
|
|
|
|
cell := MyWorksheet.FindCell(Row, 1);
|
2014-08-30 18:03:22 +00:00
|
|
|
if HasFormula(cell) then begin
|
|
|
|
actual := MyWorksheet.ReadFormulaAsString(cell);
|
2014-08-03 21:21:31 +00:00
|
|
|
expected := MyWorksheet.ReadAsUTF8Text(Row, 0);
|
|
|
|
CheckEquals(expected, actual, 'Test read formula mismatch, cell '+CellNotation(MyWorkSheet,Row,1));
|
|
|
|
end;
|
2014-05-24 20:28:05 +00:00
|
|
|
end;
|
|
|
|
|
2014-08-03 21:21:31 +00:00
|
|
|
finally
|
|
|
|
MyWorkbook.Free;
|
|
|
|
DeleteFile(TempFile);
|
|
|
|
end;
|
2014-05-24 20:28:05 +00:00
|
|
|
end;
|
|
|
|
|
2014-08-30 18:03:22 +00:00
|
|
|
procedure TSpreadWriteReadFormulaTests.Test_Write_Read_FormulaStrings_BIFF2;
|
|
|
|
begin
|
|
|
|
TestWriteReadFormulaStrings(sfExcel2, true);
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TSpreadWriteReadFormulaTests.Test_Write_Read_FormulaStrings_BIFF5;
|
2014-05-25 16:49:45 +00:00
|
|
|
begin
|
2014-08-30 18:03:22 +00:00
|
|
|
TestWriteReadFormulaStrings(sfExcel5, true);
|
2014-05-25 16:49:45 +00:00
|
|
|
end;
|
|
|
|
|
2014-08-30 18:03:22 +00:00
|
|
|
procedure TSpreadWriteReadFormulaTests.Test_Write_Read_FormulaStrings_BIFF8;
|
2014-05-25 16:49:45 +00:00
|
|
|
begin
|
2014-08-30 18:03:22 +00:00
|
|
|
TestWriteReadFormulaStrings(sfExcel8, true);
|
2014-05-25 16:49:45 +00:00
|
|
|
end;
|
|
|
|
|
2014-08-30 18:03:22 +00:00
|
|
|
procedure TSpreadWriteReadFormulaTests.Test_Write_Read_FormulaStrings_OOXML;
|
2014-05-24 20:28:05 +00:00
|
|
|
begin
|
2014-08-30 18:03:22 +00:00
|
|
|
TestWriteReadFormulaStrings(sfOOXML, true);
|
2014-05-24 20:28:05 +00:00
|
|
|
end;
|
|
|
|
|
2014-09-01 13:21:39 +00:00
|
|
|
procedure TSpreadWriteReadFormulaTests.Test_Write_Read_FormulaStrings_ODS;
|
|
|
|
begin
|
2014-09-02 09:25:54 +00:00
|
|
|
TestWriteReadFormulaStrings(sfOpenDocument, true);
|
2014-09-01 13:21:39 +00:00
|
|
|
end;
|
|
|
|
|
2014-06-28 19:40:28 +00:00
|
|
|
|
2014-08-30 18:03:22 +00:00
|
|
|
{ Test calculation of formulas }
|
2014-06-28 19:40:28 +00:00
|
|
|
|
2014-08-30 18:03:22 +00:00
|
|
|
procedure TSpreadWriteReadFormulaTests.TestCalcFormulas(AFormat: TsSpreadsheetFormat;
|
|
|
|
UseRPNFormula: Boolean);
|
|
|
|
{ If UseRPNFormula is TRUE, the test formulas are generated from RPN syntax,
|
|
|
|
otherwise string formulas are used. }
|
2014-06-28 19:40:28 +00:00
|
|
|
const
|
|
|
|
SHEET = 'Sheet1';
|
|
|
|
var
|
|
|
|
MyWorksheet: TsWorksheet;
|
|
|
|
MyWorkbook: TsWorkbook;
|
|
|
|
Row: Integer;
|
|
|
|
TempFile: string; //write xls/xml to this file and read back from it
|
2014-08-30 18:03:22 +00:00
|
|
|
actual: TsExpressionResult;
|
|
|
|
expected: TsExpressionResult;
|
2014-06-28 19:40:28 +00:00
|
|
|
cell: PCell;
|
2014-08-30 18:03:22 +00:00
|
|
|
sollValues: array of TsExpressionResult;
|
2014-06-30 13:21:04 +00:00
|
|
|
formula: String;
|
2014-07-01 12:55:02 +00:00
|
|
|
s: String;
|
|
|
|
hr,min,sec,msec: Word;
|
2014-07-19 13:33:04 +00:00
|
|
|
ErrorMargin: double;
|
2014-07-19 23:14:53 +00:00
|
|
|
k: Integer;
|
|
|
|
{ When comparing soll and formula values we must make sure that the soll
|
|
|
|
values are calculated from double precision numbers, they are used in
|
|
|
|
the formula calculation as well. The next variables, along with STATS_NUMBERS
|
|
|
|
above, hold the arguments for the direction function calls. }
|
|
|
|
number: Double;
|
2014-08-30 18:03:22 +00:00
|
|
|
cellB1: Double;
|
|
|
|
cellB2: Double;
|
2014-06-28 19:40:28 +00:00
|
|
|
begin
|
2014-07-19 23:14:53 +00:00
|
|
|
ErrorMargin:=0; //1.44E-7;
|
2014-07-19 13:33:04 +00:00
|
|
|
//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
|
|
|
|
|
2014-06-28 19:40:28 +00:00
|
|
|
// Create test workbook
|
|
|
|
MyWorkbook := TsWorkbook.Create;
|
2014-08-03 21:21:31 +00:00
|
|
|
try
|
2014-08-13 19:23:59 +00:00
|
|
|
MyWorkbook.Options := MyWorkbook.Options + [boCalcBeforeSaving];
|
2014-08-03 21:21:31 +00:00
|
|
|
// Calculation of rpn formulas must be activated explicitly!
|
|
|
|
|
2014-08-13 19:23:59 +00:00
|
|
|
MyWorkSheet:= MyWorkBook.AddWorksheet(SHEET);
|
2014-08-03 21:21:31 +00:00
|
|
|
{ Write out test formulas.
|
|
|
|
This include file creates various rpn formulas and stores the expected
|
|
|
|
results in array "sollValues".
|
|
|
|
The test file contains the text representation in column A, and the
|
|
|
|
formula in column B. }
|
|
|
|
Row := 0;
|
|
|
|
TempFile:=GetTempFileName;
|
2014-08-11 11:16:43 +00:00
|
|
|
{$I testcases_calcrpnformula.inc}
|
2014-08-03 21:21:31 +00:00
|
|
|
MyWorkBook.WriteToFile(TempFile, AFormat, true);
|
|
|
|
finally
|
|
|
|
MyWorkbook.Free;
|
|
|
|
end;
|
2014-06-28 19:40:28 +00:00
|
|
|
|
|
|
|
// Open the workbook
|
|
|
|
MyWorkbook := TsWorkbook.Create;
|
2014-08-03 21:21:31 +00:00
|
|
|
try
|
2014-08-30 18:03:22 +00:00
|
|
|
MyWorkbook.Options := Myworkbook.Options + [boReadFormulas];
|
2014-08-03 21:21:31 +00:00
|
|
|
MyWorkbook.ReadFromFile(TempFile, AFormat);
|
|
|
|
if AFormat = sfExcel2 then
|
|
|
|
MyWorksheet := MyWorkbook.GetFirstWorksheet
|
|
|
|
else
|
|
|
|
MyWorksheet := GetWorksheetByName(MyWorkBook, SHEET);
|
|
|
|
if MyWorksheet=nil then
|
|
|
|
fail('Error in test code. Failed to get named worksheet');
|
|
|
|
|
|
|
|
for Row := 0 to MyWorksheet.GetLastRowIndex do
|
|
|
|
begin
|
|
|
|
formula := MyWorksheet.ReadAsUTF8Text(Row, 0);
|
|
|
|
cell := MyWorksheet.FindCell(Row, 1);
|
|
|
|
if (cell = nil) then
|
|
|
|
fail('Error in test code: Failed to get cell ' + CellNotation(MyWorksheet, Row, 1));
|
2014-08-30 18:03:22 +00:00
|
|
|
|
2014-08-03 21:21:31 +00:00
|
|
|
case cell^.ContentType of
|
2014-08-30 18:03:22 +00:00
|
|
|
cctBool : actual := BooleanResult(cell^.BoolValue);
|
|
|
|
cctNumber : actual := FloatResult(cell^.NumberValue);
|
|
|
|
cctDateTime : actual := DateTimeResult(cell^.DateTimeValue);
|
|
|
|
cctUTF8String : actual := StringResult(cell^.UTF8StringValue);
|
|
|
|
cctError : actual := ErrorResult(cell^.ErrorValue);
|
|
|
|
cctEmpty : actual := EmptyResult;
|
2014-08-03 21:21:31 +00:00
|
|
|
else fail('ContentType not supported');
|
|
|
|
end;
|
2014-08-30 18:03:22 +00:00
|
|
|
|
2014-08-03 21:21:31 +00:00
|
|
|
expected := SollValues[row];
|
2014-08-30 18:03:22 +00:00
|
|
|
// Cell does not store integers!
|
|
|
|
if expected.ResultType = rtInteger then expected := FloatResult(expected.ResInteger);
|
|
|
|
|
|
|
|
CheckEquals(
|
|
|
|
GetEnumName(TypeInfo(TsExpressionResult), ord(expected.ResultType)),
|
|
|
|
GetEnumName(TypeInfo(TsExpressionResult), ord(actual.ResultType)),
|
2014-08-03 21:21:31 +00:00
|
|
|
'Test read calculated formula data type mismatch, formula "' + formula +
|
|
|
|
'", cell '+CellNotation(MyWorkSheet,Row,1));
|
|
|
|
|
|
|
|
// The now function result is volatile, i.e. changes continuously. The
|
|
|
|
// time for the soll value was created such that we can expect to have
|
|
|
|
// the file value in the same second. Therefore we neglect the milliseconds.
|
|
|
|
if formula = '=NOW()' then begin
|
|
|
|
// Round soll value to seconds
|
2014-08-30 18:03:22 +00:00
|
|
|
DecodeTime(expected.ResDateTime, hr,min,sec,msec);
|
|
|
|
expected.ResDateTime := EncodeTime(hr, min, sec, 0);
|
2014-08-03 21:21:31 +00:00
|
|
|
// Round formula value to seconds
|
2014-08-30 18:03:22 +00:00
|
|
|
DecodeTime(actual.ResDateTime, hr,min,sec,msec);
|
|
|
|
actual.ResDateTime := EncodeTime(hr,min,sec,0);
|
2014-08-03 21:21:31 +00:00
|
|
|
end;
|
|
|
|
|
2014-08-30 18:03:22 +00:00
|
|
|
case actual.ResultType of
|
|
|
|
rtBoolean:
|
|
|
|
CheckEquals(BoolToStr(expected.ResBoolean), BoolToStr(actual.ResBoolean),
|
2014-08-03 21:21:31 +00:00
|
|
|
'Test read calculated formula result mismatch, formula "' + formula +
|
|
|
|
'", cell '+CellNotation(MyWorkSheet,Row,1));
|
2014-08-30 18:03:22 +00:00
|
|
|
rtFloat:
|
2014-08-03 21:21:31 +00:00
|
|
|
{$if (defined(mswindows)) or (FPC_FULLVERSION>=20701)}
|
|
|
|
// FPC 2.6.x and trunk on Windows need this, also FPC trunk on Linux x64
|
2014-08-30 18:03:22 +00:00
|
|
|
CheckEquals(expected.ResFloat, actual.ResFloat, ErrorMargin,
|
2014-08-03 21:21:31 +00:00
|
|
|
'Test read calculated formula result mismatch, formula "' + formula +
|
|
|
|
'", cell '+CellNotation(MyWorkSheet,Row,1));
|
|
|
|
{$else}
|
|
|
|
// Non-Windows: test without error margin
|
|
|
|
CheckEquals(expected.NumberValue, actual.NumberValue,
|
|
|
|
'Test read calculated formula result mismatch, formula "' + formula +
|
|
|
|
'", cell '+CellNotation(MyWorkSheet,Row,1));
|
|
|
|
{$endif}
|
2014-08-30 18:03:22 +00:00
|
|
|
rtString:
|
|
|
|
CheckEquals(expected.ResString, actual.ResString,
|
2014-08-03 21:21:31 +00:00
|
|
|
'Test read calculated formula result mismatch, formula "' + formula +
|
|
|
|
'", cell '+CellNotation(MyWorkSheet,Row,1));
|
2014-08-30 18:03:22 +00:00
|
|
|
rtError:
|
2014-08-03 21:21:31 +00:00
|
|
|
CheckEquals(
|
2014-08-30 18:03:22 +00:00
|
|
|
GetEnumName(TypeInfo(TsErrorValue), ord(expected.ResError)),
|
|
|
|
GetEnumname(TypeInfo(TsErrorValue), ord(actual.ResError)),
|
2014-08-03 21:21:31 +00:00
|
|
|
'Test read calculated formula error value mismatch, formula ' + formula +
|
|
|
|
', cell '+CellNotation(MyWorkSheet,Row,1));
|
|
|
|
end;
|
2014-07-19 23:14:53 +00:00
|
|
|
end;
|
|
|
|
|
2014-08-03 21:21:31 +00:00
|
|
|
finally
|
|
|
|
MyWorkbook.Free;
|
|
|
|
DeleteFile(TempFile);
|
2014-06-28 19:40:28 +00:00
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
2014-08-30 18:03:22 +00:00
|
|
|
procedure TSpreadWriteReadFormulaTests.Test_Write_Read_CalcRPNFormula_BIFF2;
|
|
|
|
begin
|
|
|
|
TestCalcFormulas(sfExcel2, true);
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TSpreadWriteReadFormulaTests.Test_Write_Read_CalcRPNFormula_BIFF5;
|
|
|
|
begin
|
|
|
|
TestCalcFormulas(sfExcel5, true);
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TSpreadWriteReadFormulaTests.Test_Write_Read_CalcRPNFormula_BIFF8;
|
|
|
|
begin
|
|
|
|
TestCalcFormulas(sfExcel8, true);
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TSpreadWriteReadFormulaTests.Test_Write_Read_CalcRPNFormula_OOXML;
|
|
|
|
begin
|
|
|
|
TestCalcFormulas(sfOOXML, true);
|
|
|
|
end;
|
|
|
|
|
2014-09-02 09:25:54 +00:00
|
|
|
procedure TSpreadWriteReadFormulaTests.Test_Write_Read_CalcRPNFormula_ODS;
|
|
|
|
begin
|
|
|
|
TestCalcFormulas(sfOpenDocument, true);
|
|
|
|
end;
|
|
|
|
|
2014-08-30 18:03:22 +00:00
|
|
|
procedure TSpreadWriteReadFormulaTests.Test_Write_Read_CalcStringFormula_BIFF2;
|
|
|
|
begin
|
|
|
|
TestCalcFormulas(sfExcel2, false);
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TSpreadWriteReadFormulaTests.Test_Write_Read_CalcStringFormula_BIFF5;
|
2014-07-01 22:47:10 +00:00
|
|
|
begin
|
2014-08-30 18:03:22 +00:00
|
|
|
TestCalcFormulas(sfExcel5, false);
|
2014-07-01 22:47:10 +00:00
|
|
|
end;
|
|
|
|
|
2014-08-30 18:03:22 +00:00
|
|
|
procedure TSpreadWriteReadFormulaTests.Test_Write_Read_CalcStringFormula_BIFF8;
|
2014-07-01 22:47:10 +00:00
|
|
|
begin
|
2014-08-30 18:03:22 +00:00
|
|
|
TestCalcFormulas(sfExcel8, false);
|
2014-07-01 22:47:10 +00:00
|
|
|
end;
|
2014-06-28 19:40:28 +00:00
|
|
|
|
2014-08-30 18:03:22 +00:00
|
|
|
procedure TSpreadWriteReadFormulaTests.Test_Write_Read_CalcStringFormula_OOXML;
|
2014-06-28 19:40:28 +00:00
|
|
|
begin
|
2014-08-30 18:03:22 +00:00
|
|
|
TestCalcFormulas(sfOOXML, false);
|
2014-06-28 19:40:28 +00:00
|
|
|
end;
|
|
|
|
|
2014-09-02 09:25:54 +00:00
|
|
|
procedure TSpreadWriteReadFormulaTests.Test_Write_Read_CalcStringFormula_ODS;
|
|
|
|
begin
|
|
|
|
TestCalcFormulas(sfOpenDocument, false);
|
|
|
|
end;
|
|
|
|
|
2014-06-28 19:40:28 +00:00
|
|
|
|
2014-05-24 20:28:05 +00:00
|
|
|
initialization
|
|
|
|
// Register so these tests are included in a full run
|
|
|
|
RegisterTest(TSpreadWriteReadFormulaTests);
|
|
|
|
|
|
|
|
|
|
|
|
end.
|
|
|
|
|