[fpc-devel] Re: Test fails under FPC but passes under Delphi

Graeme Geldenhuys graemeg.lists at gmail.com
Mon Nov 19 09:41:33 CET 2007


>
> procedure TTestTIBaseObject.ValidFail1;
> var
>   LO : TtiBaseObject;
> begin
>   LO := TtiBaseObject(Random(20000)+2000);
>   writeln(' here we start');  // debug line
>   LO.TestValid(False);  //  <==========  AV occurs here
>   writeln('passed 1');  // debug line
> //  check(not LO.TestValid(False));
>   writeln('passed 2');  // debug line
> end;
>
>


Here is a variation of the test above and it also never works under
FPC, but does under Delphi.

procedure TTestTIBaseObject.ValidFail2;
var
  LO : TtiBaseObject;
begin
  LO:= TtiBaseObject.Create;
  LO.free;
  {$IFNDEF FPC}
  check(not LO.TestValid);
  {$ELSE}
  check(True, 'FPC does not support this.');
  {$ENDIF}
end;




Regards,
  - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/



More information about the fpc-devel mailing list