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