2004-07-29 08:33:18 +02:00
|
|
|
program X2UtHashesTest;
|
|
|
|
|
|
|
|
{$APPTYPE CONSOLE}
|
|
|
|
|
|
|
|
uses
|
2013-02-15 12:28:24 +01:00
|
|
|
madListHardware,
|
|
|
|
madListProcesses,
|
|
|
|
madListModules,
|
2004-07-29 08:33:18 +02:00
|
|
|
madExcept,
|
|
|
|
madLinkDisAsm,
|
|
|
|
SysUtils,
|
|
|
|
X2UtHashes,
|
2004-08-20 12:03:59 +02:00
|
|
|
X2UtBinaryTree,
|
|
|
|
FBTree in 'Forms\FBTree.pas' {frmBTree};
|
2004-07-29 08:33:18 +02:00
|
|
|
|
|
|
|
|
|
|
|
var
|
2004-09-01 21:31:28 +02:00
|
|
|
shData: TX2StringHash;
|
|
|
|
btTest: TX2StringBTree;
|
2004-07-29 08:33:18 +02:00
|
|
|
iItem: Integer;
|
2004-09-01 21:31:28 +02:00
|
|
|
pItem: PX2BTreeNode;
|
2004-07-29 08:33:18 +02:00
|
|
|
|
|
|
|
begin
|
|
|
|
// Test binary tree
|
2004-09-01 21:31:28 +02:00
|
|
|
btTest := TX2StringBTree.Create();
|
2004-07-29 08:33:18 +02:00
|
|
|
try
|
|
|
|
Randomize();
|
2004-08-20 12:03:59 +02:00
|
|
|
for iItem := 0 to 61 do
|
2004-07-29 08:33:18 +02:00
|
|
|
btTest[Random(500)] := 'bla';
|
2004-09-01 21:31:28 +02:00
|
|
|
btTest[40] := 'bla2';
|
|
|
|
btTest[50] := 'bla3';
|
2004-07-29 08:33:18 +02:00
|
|
|
|
2004-09-01 21:31:28 +02:00
|
|
|
if btTest.Exists(40, True) then
|
|
|
|
WriteLn(btTest.CurrentValue);
|
2004-07-29 08:33:18 +02:00
|
|
|
|
|
|
|
WriteLn;
|
|
|
|
btTest.Reset();
|
|
|
|
while btTest.Next() do
|
|
|
|
WriteLn(btTest.CurrentIndex, ' - ', btTest.CurrentValue);
|
2004-09-01 21:31:28 +02:00
|
|
|
|
|
|
|
TfrmBTree.Execute(btTest);
|
2004-07-29 08:33:18 +02:00
|
|
|
finally
|
|
|
|
FreeAndNil(btTest);
|
2004-09-01 21:31:28 +02:00
|
|
|
ReadLn;
|
2004-07-29 08:33:18 +02:00
|
|
|
end;
|
|
|
|
|
2004-09-01 21:31:28 +02:00
|
|
|
(*
|
2004-07-29 08:33:18 +02:00
|
|
|
shData := TX2UtStringHash.Create();
|
|
|
|
try
|
2004-07-29 17:49:42 +02:00
|
|
|
shData['thisakslhalskdjfhaslkdfjhaslkfjh'] := 'is';
|
2004-07-29 08:33:18 +02:00
|
|
|
shData['a'] := 'test';
|
|
|
|
|
2004-08-20 12:03:59 +02:00
|
|
|
TfrmBTree.Execute(shData);
|
|
|
|
|
|
|
|
{
|
2004-07-29 08:33:18 +02:00
|
|
|
shData.Reset();
|
|
|
|
while shData.Next() do
|
2004-07-29 15:48:35 +02:00
|
|
|
WriteLn(shData.CurrentKey, ': ', shData.CurrentValue, ' (',
|
|
|
|
shData[shData.CurrentKey], ')');
|
2004-08-20 12:03:59 +02:00
|
|
|
}
|
2004-07-29 08:33:18 +02:00
|
|
|
finally
|
|
|
|
FreeAndNil(shData);
|
2004-08-20 12:03:59 +02:00
|
|
|
//ReadLn;
|
2004-07-29 08:33:18 +02:00
|
|
|
end;
|
2004-09-01 21:31:28 +02:00
|
|
|
*)
|
2004-07-29 08:33:18 +02:00
|
|
|
end.
|