1
0
mirror of synced 2024-11-09 12:59:16 +00:00
x2utils/Test/X2UtHashesTest.dpr
Mark van Renswoude bc366730a2 Fixed: LookupNode would sometimes return nil after creating a node and balancing the tree
Fixed: SetCursor in LookupNode was not implemented
Fixed: Next followed an incorrect path
2004-09-01 19:31:28 +00:00

64 lines
1.2 KiB
ObjectPascal

program X2UtHashesTest;
{$APPTYPE CONSOLE}
uses
madExcept,
madLinkDisAsm,
SysUtils,
X2UtHashes,
X2UtBinaryTree,
FBTree in 'Forms\FBTree.pas' {frmBTree};
var
shData: TX2StringHash;
btTest: TX2StringBTree;
iItem: Integer;
pItem: PX2BTreeNode;
begin
// Test binary tree
btTest := TX2StringBTree.Create();
try
Randomize();
for iItem := 0 to 61 do
btTest[Random(500)] := 'bla';
btTest[40] := 'bla2';
btTest[50] := 'bla3';
if btTest.Exists(40, True) then
WriteLn(btTest.CurrentValue);
WriteLn;
btTest.Reset();
while btTest.Next() do
WriteLn(btTest.CurrentIndex, ' - ', btTest.CurrentValue);
TfrmBTree.Execute(btTest);
finally
FreeAndNil(btTest);
ReadLn;
end;
(*
shData := TX2UtStringHash.Create();
try
shData['thisakslhalskdjfhaslkdfjhaslkfjh'] := 'is';
shData['a'] := 'test';
TfrmBTree.Execute(shData);
{
shData.Reset();
while shData.Next() do
WriteLn(shData.CurrentKey, ': ', shData.CurrentValue, ' (',
shData[shData.CurrentKey], ')');
}
finally
FreeAndNil(shData);
//ReadLn;
end;
*)
end.