Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2007-11

Re: Test fails under FPC but passes under Delphi

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys
Show quoted text 14 lines
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/

Reply by email