Test suite results for test file tbs/tb0210.pp

Test run data :

Free Pascal Compiler Test Suite Results

View Test suite results

Please specify search criteria:
File:
Operating system:
Processor:
Version
Date
Submitter
Machine
Comment
Limit
Cond
Category
Only failed tests
Hide skipped tests
List all tests

Test file "tbs/tb0210.pp" information:

t_id 443
t_adddate 2003/10/03
t_result 0
t_knownrunerror 0

Detailed test run results:

Record count: 50

Total = 50

OK=50 Percentage= 100.00

Result type Cat. Count Percentage First date Last Date
Successfully run 50 100.0 2024/06/02 05:33:00 33 2024/06/02 09:07:00 0
i386 4 8.0 2024/06/02 06:52:00 176 2024/06/02 09:07:00 0
m68k 3 6.0 2024/06/02 06:59:00 190 2024/06/02 07:38:00 58
sparc 3 6.0 2024/06/02 07:40:00 63 2024/06/02 07:48:00 74
powerpc 5 10.0 2024/06/02 06:28:00 184 2024/06/02 07:58:00 246
arm 1 2.0 2024/06/02 07:18:00 40 2024/06/02 07:18:00 40
x86_64 5 10.0 2024/06/02 05:33:00 33 2024/06/02 08:10:00 0
powerpc64 6 12.0 2024/06/02 07:20:00 242 2024/06/02 07:35:00 71
mips 3 6.0 2024/06/02 07:06:00 240 2024/06/02 07:45:00 246
mipsel 5 10.0 2024/06/02 06:21:00 148 2024/06/02 07:53:00 52
aarch64 9 18.0 2024/06/02 06:09:00 30 2024/06/02 08:02:00 37
sparc64 4 8.0 2024/06/02 07:14:00 164 2024/06/02 08:05:00 0
riscv64 1 2.0 2024/06/02 07:42:00 31 2024/06/02 07:42:00 31
loongarch64 1 2.0 2024/06/02 07:32:00 38 2024/06/02 07:32:00 38
linux 41 82.0 2024/06/02 06:21:00 148 2024/06/02 08:10:00 0
go32v2 1 2.0 2024/06/02 07:53:00 69 2024/06/02 07:53:00 69
solaris 3 6.0 2024/06/02 05:33:00 33 2024/06/02 09:07:00 0
darwin 5 10.0 2024/06/02 06:09:00 30 2024/06/02 07:14:00 47
3.3.1 26 52.0 2024/06/02 05:33:00 33 2024/06/02 08:10:00 0
3.2.3 24 48.0 2024/06/02 06:21:00 148 2024/06/02 09:07:00 0

Source:

{ Old file: tbs0249.pp }
{ procedure of object cannot be assigned to property.  OK 0.99.11 (PFV) }

program TestEvent;

{$mode objfpc}
{$M+}

type
  TNotifyEvent = procedure( Sender: TObject ) of object;

  THost = class
  protected
    FOnEvent: TNotifyEvent;
    procedure SetOnEvent( Value: TNotifyEvent );
  public
    constructor Create;
    procedure Trigger;
    procedure SayHello;
  published
    property OnEvent: TNotifyEvent read FOnEvent write SetOnEvent;
  end;

  TDummy = class
    procedure HandleEvent( Sender: TObject );
  end;

constructor THost.Create;
begin
  FOnEvent := nil;
end;

procedure THost.Trigger;
begin
  if @FOnEvent <> nil then
    FOnEvent( Self )
end;

procedure THost.SetOnEvent( Value: TNotifyEvent );
begin
  FOnEvent := Value
end;

procedure THost.SayHello;
begin
  Writeln( 'Hello event' )
end;

procedure TDummy.HandleEvent( Sender: TObject );
begin
  THost( Sender ).SayHello
end;


var
  Host: THost;
  Dummy: TDummy;
begin
  Dummy := TDummy.Create;
  Host := THost.Create;
  with Host,Dummy do
    OnEvent := @HandleEvent; // this is 57, 27 is ";"
  Host.Trigger;
end.

Link to SVN view of tbs/tb0210.pp source.