mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 15:28:08 +02:00

Commit message of patch: + New field TotalFieldCount for TTypeData * Mark ManagedFldCount as deprecated * Adjusted test trtti12.pp git-svn-id: trunk@35180 -
36 lines
466 B
ObjectPascal
36 lines
466 B
ObjectPascal
program trtti12;
|
|
|
|
{$MODE DELPHI}
|
|
|
|
uses
|
|
TypInfo;
|
|
|
|
type
|
|
PFoo = ^TFoo;
|
|
TFoo = packed record
|
|
public
|
|
B: Byte;
|
|
W: Word;
|
|
L: LongWord;
|
|
S: string;
|
|
I: IInterface;
|
|
A: TArray<byte>;
|
|
end;
|
|
|
|
var
|
|
td: PTypeData;
|
|
id: PRecInitData;
|
|
begin
|
|
td := GetTypeData(TypeInfo(TFoo));
|
|
|
|
id := td.RecInitData;
|
|
if id.Terminator <> nil then
|
|
Halt(1);
|
|
|
|
if td.TotalFieldCount <> 6 then
|
|
Halt(2);
|
|
|
|
if id.ManagedFieldCount <> 3 then
|
|
Halt(3);
|
|
end.
|