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/05/20 22:37:00 176 2024/05/21 00:32:00 15
i386 18 36.0 2024/05/20 22:37:00 176 2024/05/21 00:08:00 23
sparc 21 42.0 2024/05/20 23:25:00 38 2024/05/20 23:55:00 41
powerpc 1 2.0 2024/05/20 23:05:00 185 2024/05/20 23:05:00 185
x86_64 5 10.0 2024/05/20 23:44:00 14 2024/05/21 00:32:00 15
powerpc64 2 4.0 2024/05/20 23:13:00 213 2024/05/20 23:20:00 71
mipsel 1 2.0 2024/05/20 22:58:00 148 2024/05/20 22:58:00 148
aarch64 1 2.0 2024/05/21 00:12:00 32 2024/05/21 00:12:00 32
sparc64 1 2.0 2024/05/20 23:47:00 148 2024/05/20 23:47:00 148
linux 17 34.0 2024/05/20 22:37:00 176 2024/05/21 00:32:00 15
win32 1 2.0 2024/05/20 23:41:00 23 2024/05/20 23:41:00 23
solaris 32 64.0 2024/05/20 23:23:00 25 2024/05/20 23:55:00 41
3.3.1 28 56.0 2024/05/20 23:23:00 25 2024/05/21 00:32:00 15
3.2.3 22 44.0 2024/05/20 22:37:00 176 2024/05/21 00:08:00 23

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.