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=4 Percentage= 8.00

Result type Cat. Count Percentage First date Last Date
Failed to run 46 92.0 2024/05/08 16:30:00 33 2024/05/08 21:30:00 24
i386 3 6.5 2024/05/08 19:08:00 176 2024/05/08 20:34:00 44
m68k 3 6.5 2024/05/08 19:15:00 190 2024/05/08 20:43:00 63
sparc 2 4.3 2024/05/08 20:01:00 79 2024/05/08 20:42:00 81
powerpc 2 4.3 2024/05/08 19:37:00 185 2024/05/08 20:18:00 184
arm 3 6.5 2024/05/08 19:02:00 59 2024/05/08 20:25:00 69
x86_64 7 15.2 2024/05/08 19:43:00 23 2024/05/08 21:30:00 24
powerpc64 6 13.0 2024/05/08 19:44:00 213 2024/05/08 21:28:00 73
mips 3 6.5 2024/05/08 19:23:00 240 2024/05/08 20:52:00 160
mipsel 3 6.5 2024/05/08 19:30:00 229 2024/05/08 21:02:00 151
aarch64 12 26.1 2024/05/08 16:30:00 33 2024/05/08 20:16:00 46
sparc64 2 4.3 2024/05/08 20:18:00 148 2024/05/08 21:03:00 163
linux 32 69.6 2024/05/08 18:55:00 44 2024/05/08 21:28:00 73
darwin 9 19.6 2024/05/08 16:30:00 33 2024/05/08 17:40:00 56
win64 5 10.9 2024/05/08 19:43:00 23 2024/05/08 21:30:00 24
3.2.3 46 100.0 2024/05/08 16:30:00 33 2024/05/08 21:30:00 24
Successfully run 4 8.0 2024/05/08 16:39:00 49 2024/05/08 19:00:00 22
i386 3 75.0 2024/05/08 17:34:00 34 2024/05/08 19:00:00 22
mips 1 25.0 2024/05/08 16:39:00 49 2024/05/08 16:39:00 49
linux 1 25.0 2024/05/08 16:39:00 49 2024/05/08 16:39:00 49
win32 3 75.0 2024/05/08 17:34:00 34 2024/05/08 19:00:00 22
3.3.1 4 100.0 2024/05/08 16:39:00 49 2024/05/08 19:00:00 22

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.