Test suite results for test file webtbs/tw2886.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 "webtbs/tw2886.pp" information:

t_id 1237
t_adddate 2004/01/23
t_result 0
t_knownrunerror 0

Detailed test run results:

Record count: 50

Total = 50

OK=34 Percentage= 68.00

Result type Cat. Count Percentage First date Last Date
Failed to run 16 32.0 2024/09/26 21:17:00 71 2024/09/26 23:02:00 44
powerpc 2 12.5 2024/09/26 22:51:00 44 2024/09/26 23:02:00 44
powerpc64 14 87.5 2024/09/26 21:17:00 71 2024/09/26 22:29:00 103
linux 16 100.0 2024/09/26 21:17:00 71 2024/09/26 23:02:00 44
3.2.3 16 100.0 2024/09/26 21:17:00 71 2024/09/26 23:02:00 44
Successfully run 34 68.0 2024/09/26 18:42:00 90 2024/09/26 22:50:00 299
i386 4 11.8 2024/09/26 19:54:00 70 2024/09/26 22:38:00 79
powerpc 12 35.3 2024/09/26 19:41:00 35 2024/09/26 20:38:00 84
powerpc64 3 8.8 2024/09/26 18:42:00 90 2024/09/26 19:18:00 143
wasm32 7 20.6 2024/09/26 19:31:00 339 2024/09/26 22:50:00 299
riscv64 8 23.5 2024/09/26 19:14:00 123 2024/09/26 19:59:00 123
linux 23 67.6 2024/09/26 18:42:00 90 2024/09/26 20:38:00 84
go32v2 4 11.8 2024/09/26 19:54:00 70 2024/09/26 22:38:00 79
wasi 7 20.6 2024/09/26 19:31:00 339 2024/09/26 22:50:00 299
3.3.1 34 100.0 2024/09/26 18:42:00 90 2024/09/26 22:50:00 299

Source:

{ Source provided for Free Pascal Bug Report 2886 }
{ Submitted by "Mattias Gaertner" on  2004-01-08 }
{ e-mail: mattias@freepascal.org }
program WrongRTTIParams;

{$mode objfpc}{$H+}

uses
  Classes, SysUtils, TypInfo;

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

  TMyClass = class(TPersistent)
  private
    FMyEvent: TAnEvent;
  public
    procedure ShowRTTI;
  published
    property MyEvent: TAnEvent read FMyEvent write FMyEvent;
  end;

{ TMyClass }

procedure TMyClass.ShowRTTI;
var
  TypeData: PTypeData;
  ParamCount: Integer;
  Offset: Integer;
  Len: Integer;
  CurParamName: string;
  CurTypeIdentifier: string;
  i: Integer;
begin
  TypeData:=GetTypeData(GetPropInfo(Self,'MyEvent')^.PropType);
  ParamCount:=TypeData^.ParamCount;
  Offset:=0;

  i:=0;
//  for i:=0 to ParamCount-1 do begin

    // SizeOf(TParamFlags) is 4, but the data is only 1 byte
    Len:=1; // typinfo.pp comment is wrong: SizeOf(TParamFlags)
    inc(Offset,Len);

    // read ParamName
    Len:=ord(TypeData^.ParamList[Offset]);
    SetLength(CurParamName,Len);
    if Len>0 then
      Move(TypeData^.ParamList[Offset+1],CurParamName[1],Len);
    inc(Offset,Len+1);

    // read ParamType
    Len:=ord(TypeData^.ParamList[Offset]);
    SetLength(CurTypeIdentifier,Len);
    if CurTypeIdentifier<>'' then
      Move(TypeData^.ParamList[Offset+1],CurTypeIdentifier[1],Len);
    inc(Offset,Len+1);

    writeln('Param ',i+1,'/',ParamCount,' ',CurParamName,':',CurTypeIdentifier);
    if (CurParamName<>'Sender')  or (CurTypeIdentifier<>'TObject') then
      begin
        writeln('ERROR!');
        halt(1);
      end;

//  end;
end;

var
  MyClass: TMyClass;
begin
  MyClass:=TMyClass.Create;
  MyClass.ShowRTTI;
end.

Link to SVN view of webtbs/tw2886.pp source.