mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 16:09:27 +02:00
* Added stringlist and int64 tests
git-svn-id: trunk@41815 -
(cherry picked from commit d13f0c3f80
)
This commit is contained in:
parent
84103be6e6
commit
e005d72307
@ -22,6 +22,8 @@ type
|
|||||||
procedure TestDoubleWrite;
|
procedure TestDoubleWrite;
|
||||||
procedure bug16395;
|
procedure bug16395;
|
||||||
procedure TestAdv;
|
procedure TestAdv;
|
||||||
|
procedure TestStringList;
|
||||||
|
Procedure TestInt64;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -171,6 +173,53 @@ begin
|
|||||||
{$endif windows}
|
{$endif windows}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Procedure TTestBasics.TestStringList;
|
||||||
|
|
||||||
|
Var
|
||||||
|
SL : TStringList;
|
||||||
|
I : Integer;
|
||||||
|
|
||||||
|
begin
|
||||||
|
With TRegistry.Create do
|
||||||
|
try
|
||||||
|
RootKey:=HKEY_CURRENT_USER;
|
||||||
|
OpenKey('Software/Test',True);
|
||||||
|
SL:=TstringList.Create;
|
||||||
|
For I:=0 to 10 do
|
||||||
|
SL.Add(IntToStr(I));
|
||||||
|
WriteStringList('me',SL);
|
||||||
|
SL.Clear;
|
||||||
|
ReadStringList('me',SL);
|
||||||
|
For I:=0 to 10 do
|
||||||
|
AssertEquals('String '+IntToStr(i),IntToStr(I),SL[I]);
|
||||||
|
finally
|
||||||
|
Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TTestBasics.TestInt64;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Var
|
||||||
|
Def,I64 : Int64;
|
||||||
|
|
||||||
|
begin
|
||||||
|
def:=MaxInt*1024;
|
||||||
|
With TRegistry.Create do
|
||||||
|
try
|
||||||
|
RootKey:=HKEY_CURRENT_USER;
|
||||||
|
OpenKey('Software/Test',True);
|
||||||
|
WriteInt64('you',Def);
|
||||||
|
I64:=ReadInt64('you');
|
||||||
|
AssertEquals('Value written and read',Def,I64);
|
||||||
|
finally
|
||||||
|
Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
RegisterTest(TTestBasics);
|
RegisterTest(TTestBasics);
|
||||||
end.
|
end.
|
||||||
|
Loading…
Reference in New Issue
Block a user