mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-16 06:59:36 +01:00
+ 868
This commit is contained in:
parent
fc79a7c2ab
commit
755e41ba4a
50
tests/webtbs/tbug868.pp
Normal file
50
tests/webtbs/tbug868.pp
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
{$mode objfpc}
|
||||||
|
type
|
||||||
|
TTreeData = record
|
||||||
|
Key: String;
|
||||||
|
Data: Integer;
|
||||||
|
end;
|
||||||
|
|
||||||
|
TNode = class
|
||||||
|
data: TTreeData;
|
||||||
|
end;
|
||||||
|
|
||||||
|
TStrIntDic = class
|
||||||
|
FNode: TNode;
|
||||||
|
destructor Destroy; override;
|
||||||
|
procedure Add(const Key: String; Data: Integer);
|
||||||
|
end;
|
||||||
|
|
||||||
|
destructor TStrIntDic.Destroy;
|
||||||
|
begin
|
||||||
|
FNode.Free;
|
||||||
|
inherited Destroy;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TStrIntDic.Add(const Key: String; Data: Integer);
|
||||||
|
var
|
||||||
|
T: TTreeData;
|
||||||
|
begin
|
||||||
|
T.Key:=Key;
|
||||||
|
T.Data:=Data;
|
||||||
|
FNode:=TNode.Create;
|
||||||
|
FNode.data:=T;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure Test;
|
||||||
|
var
|
||||||
|
SD: TStrIntDic;
|
||||||
|
begin
|
||||||
|
SD:=TStrIntDic.Create;
|
||||||
|
try
|
||||||
|
SD.Add('asdf', 2);
|
||||||
|
finally
|
||||||
|
SD.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
Test;
|
||||||
|
write('Test for bug 868 completed.');
|
||||||
|
{readln;}
|
||||||
|
end.
|
||||||
Loading…
Reference in New Issue
Block a user