Browse Source

* tregistry2 test: Delete reg.xml and the app config dir.

git-svn-id: trunk@48205 -
(cherry picked from commit 9fd0f94d7ca41dd8656324d4920d7030631555b3)
yury 4 years ago
parent
commit
bade890df5
1 changed files with 16 additions and 2 deletions
  1. 16 2
      tests/test/packages/fcl-registry/tregistry2.pp

+ 16 - 2
tests/test/packages/fcl-registry/tregistry2.pp

@@ -1,6 +1,7 @@
 {
   This unit tests mostly TRegIniFile to work properly and be Delphi compatible.
-  Please keep this unit Delphi compatible.
+  This test also runs on non-Windows platforms where XML registry is used.
+  Please keep this test Delphi compatible.
 }
 
 {$ifdef FPC} {$mode delphi}  {$endif}
@@ -205,6 +206,19 @@ begin
   end;
 end;
 
+procedure DeleteUserXmlFile;
 begin
-  DoRegTest2;
+{$ifdef FPC}
+  DeleteFile(Includetrailingpathdelimiter(GetAppConfigDir(False))+'reg.xml');
+  RemoveDir(GetAppConfigDir(False));
+{$endif FPC}
+end;
+
+begin
+  try
+    DoRegTest2;
+  finally
+    DeleteUserXmlFile;
+  end;
 end.
+