fpc/tests/test/cg/tcase2.pp
Jonas Maebe 0bfce99477 * fixed bug in ppc jumptable generation for case statements with
negative cases caused by wrong automatic type conversion from
    longint to unsigned tconstexprint (+ test for such jump tables)
  * fixed darwin/ppc64 jumptables in case of jmptablenorange

git-svn-id: trunk@8311 -
2007-08-26 11:15:14 +00:00

43 lines
1.3 KiB
ObjectPascal

const
maxsmallint = high(smallint);
{ error codes }
grOk = 0;
grNoInitGraph = -1;
grNotDetected = -2;
grFileNotFound = -3;
grInvalidDriver = -4;
grNoLoadMem = -5;
grNoScanMem = -6;
grNoFloodMem = -7;
grFontNotFound = -8;
grNoFontMem = -9;
grInvalidMode = -10;
grError = -11;
grIOerror = -12;
grInvalidFont = -13;
grInvalidFontNum = -14;
grInvalidVersion = -18;
function GraphErrorMsg(ErrorCode: smallint): string;
Begin
GraphErrorMsg:='';
case ErrorCode of
grOk,grFileNotFound,grInvalidDriver: exit;
grNoInitGraph: GraphErrorMsg:='Graphics driver not installed';
grNotDetected: GraphErrorMsg:='Graphics hardware not detected';
grNoLoadMem,grNoScanMem,grNoFloodMem: GraphErrorMsg := 'Not enough memory for graphics';
grNoFontMem: GraphErrorMsg := 'Not enough memory to load font';
grFontNotFound: GraphErrorMsg:= 'Font file not found';
grInvalidMode: GraphErrorMsg := 'Invalid graphics mode';
grError: GraphErrorMsg:='Graphics error';
grIoError: GraphErrorMsg:='Graphics I/O error';
grInvalidFont,grInvalidFontNum: GraphErrorMsg := 'Invalid font';
grInvalidVersion: GraphErrorMsg:='Invalid driver version';
end;
end;
begin
if GraphErrorMsg(grNoInitGraph) <> 'Graphics driver not installed' then
halt(1);
end.