* Fixed windows-only test, added linux test

git-svn-id: trunk@17176 -
This commit is contained in:
michael 2011-03-25 08:37:34 +00:00
parent dcc8afeb8b
commit 8aca294896

View File

@ -19,6 +19,7 @@ type
protected
published
procedure TestSimpleWinRegistry;
procedure TestDoubleWrite;
end;
implementation
@ -37,15 +38,49 @@ begin
// use a hopefully non existing key
AssertFalse(Registry.KeyExists('FPC1234'));
{$ifdef windows}
AssertTrue(Registry.KeyExists('SOFTWARE'));
// Registry.OpenKey('FPC', False);
// Result:=Registry.ReadString('VALUE1');
{$endif}
Registry.Free;
end;
procedure TTestBasics.TestDoubleWrite;
{$ifndef windows}
Var
FN : String;
{$endif}
begin
{$ifndef windows}
FN:=includetrailingpathdelimiter(GetAppConfigDir(False))+'reg.xml';
if FileExists(FN) then
AssertTrue(DeleteFile(FN));
{$endif}
with TRegistry.Create do
try
OpenKey('test', true);
WriteString('LAYOUT', '');
CloseKey;
finally
Free;
end;
with TRegistry.Create do
try
OpenKey('test', true);
WriteString('LAYOUT', '');
CloseKey;
finally
Free;
end;
{$ifndef windows}
FN:=includetrailingpathdelimiter(GetAppConfigDir(False))+'reg.xml';
if FileExists(FN) then
AssertTrue(DeleteFile(FN));
{$endif}
end;
initialization
RegisterTest(TTestBasics);
end.