You've already forked lazarus-ccr
fpspreadsheet: Fix font unit test for bif2 (Excel2 allows only 4 fonts per file) --> pass
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2965 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -34,22 +34,13 @@ type
|
|||||||
procedure SetUp; override;
|
procedure SetUp; override;
|
||||||
procedure TearDown; override;
|
procedure TearDown; override;
|
||||||
procedure TestWriteReadFont(AFormat: TsSpreadsheetFormat; AFontName: String);
|
procedure TestWriteReadFont(AFormat: TsSpreadsheetFormat; AFontName: String);
|
||||||
|
|
||||||
published
|
published
|
||||||
{
|
|
||||||
// BIFF2 test cases
|
// BIFF2 test cases
|
||||||
procedure TestWriteReadFontBIFF2_Arial;
|
procedure TestWriteReadFontBIFF2_Arial;
|
||||||
procedure TestWriteReadFontBIFF2_TimesNewRoman;
|
procedure TestWriteReadFontBIFF2_TimesNewRoman;
|
||||||
procedure TestWriteReadFontBIFF2_CourierNew;
|
procedure TestWriteReadFontBIFF2_CourierNew;
|
||||||
|
|
||||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
||||||
Currently the BIFF2 tests fail because of a font size mismatch at size 11.
|
|
||||||
Outside the test suite, however, this error is not reproduced,
|
|
||||||
and also not when the conflicting case is used in the SollValues alone.
|
|
||||||
|
|
||||||
STRANGE...
|
|
||||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
||||||
}
|
|
||||||
|
|
||||||
// BIFF8 test cases
|
// BIFF8 test cases
|
||||||
procedure TestWriteReadFontBIFF8_Arial;
|
procedure TestWriteReadFontBIFF8_Arial;
|
||||||
procedure TestWriteReadFontBIFF8_TimesNewRoman;
|
procedure TestWriteReadFontBIFF8_TimesNewRoman;
|
||||||
@ -130,6 +121,7 @@ var
|
|||||||
font: TsFont;
|
font: TsFont;
|
||||||
currValue: String;
|
currValue: String;
|
||||||
expectedValue: String;
|
expectedValue: String;
|
||||||
|
counter: Integer;
|
||||||
begin
|
begin
|
||||||
TempFile:=GetTempFileName;
|
TempFile:=GetTempFileName;
|
||||||
{// Not needed: use workbook.writetofile with overwrite=true
|
{// Not needed: use workbook.writetofile with overwrite=true
|
||||||
@ -170,8 +162,11 @@ begin
|
|||||||
MyWorksheet := GetWorksheetByName(MyWorkBook, FontSheet);
|
MyWorksheet := GetWorksheetByName(MyWorkBook, FontSheet);
|
||||||
if MyWorksheet=nil then
|
if MyWorksheet=nil then
|
||||||
fail('Error in test code. Failed to get named worksheet');
|
fail('Error in test code. Failed to get named worksheet');
|
||||||
|
counter := 0;
|
||||||
for row := 0 to MyWorksheet.GetLastRowNumber do
|
for row := 0 to MyWorksheet.GetLastRowNumber do
|
||||||
for col := 0 to MyWorksheet.GetLastColNumber do begin
|
for col := 0 to MyWorksheet.GetLastColNumber do begin
|
||||||
|
if (AFormat = sfExcel2) and (counter = 4) then
|
||||||
|
break; // Excel 2 allows only 4 fonts
|
||||||
MyCell := MyWorksheet.FindCell(row, col);
|
MyCell := MyWorksheet.FindCell(row, col);
|
||||||
if MyCell = nil then
|
if MyCell = nil then
|
||||||
fail('Error in test code. Failed to get cell.');
|
fail('Error in test code. Failed to get cell.');
|
||||||
@ -183,12 +178,13 @@ begin
|
|||||||
expectedValue := GetEnumName(TypeInfo(TsFontStyles), byte(SollStyles[col]));
|
expectedValue := GetEnumName(TypeInfo(TsFontStyles), byte(SollStyles[col]));
|
||||||
CheckEquals(currValue, expectedValue,
|
CheckEquals(currValue, expectedValue,
|
||||||
'Test unsaved font style, cell ' + CellNotation(MyWorksheet,0,0));
|
'Test unsaved font style, cell ' + CellNotation(MyWorksheet,0,0));
|
||||||
|
inc(counter);
|
||||||
end;
|
end;
|
||||||
MyWorkbook.Free;
|
MyWorkbook.Free;
|
||||||
|
|
||||||
DeleteFile(TempFile);
|
DeleteFile(TempFile);
|
||||||
end;
|
end;
|
||||||
(*
|
|
||||||
procedure TSpreadWriteReadFontTests.TestWriteReadFontBIFF2_Arial;
|
procedure TSpreadWriteReadFontTests.TestWriteReadFontBIFF2_Arial;
|
||||||
begin
|
begin
|
||||||
TestWriteReadFont(sfExcel2, 'Arial');
|
TestWriteReadFont(sfExcel2, 'Arial');
|
||||||
@ -203,7 +199,6 @@ procedure TSpreadWriteReadFontTests.TestWriteReadFontBIFF2_CourierNew;
|
|||||||
begin
|
begin
|
||||||
TestWriteReadFont(sfExcel2, 'CourierNew');
|
TestWriteReadFont(sfExcel2, 'CourierNew');
|
||||||
end;
|
end;
|
||||||
*)
|
|
||||||
|
|
||||||
procedure TSpreadWriteReadFontTests.TestWriteReadFontBIFF8_Arial;
|
procedure TSpreadWriteReadFontTests.TestWriteReadFontBIFF8_Arial;
|
||||||
begin
|
begin
|
||||||
|
Reference in New Issue
Block a user