Browse Source

* fixed test for Windows (the fact that it worked for Unix was due to a bug
in the Unix file locking implementation)

git-svn-id: trunk@30876 -

Jonas Maebe 10 years ago
parent
commit
be6dc49aa5
1 changed files with 1 additions and 4 deletions
  1. 1 4
      tests/webtbs/tw27998.pp

+ 1 - 4
tests/webtbs/tw27998.pp

@@ -10,16 +10,13 @@ begin
   try
     H := TFileStream.Create(lockFile, fmCreate);
     h.Write(H, 4);
-    { flush }
-    H.free;
-    { reopen in exclusive mode }
-    H := TFileStream.Create(lockfile, fmOpenWrite);
     { should fail with an exception due to exclusion }
     H := TFileStream.Create(lockFile, fmCreate);
     Halt(1);
   except
     { check the size of the file, to ensure that the second
       create didn't overwrite the file }
+    H.free;
     H := TFileStream.create(LockFile, fmOpenRead or fmShareDenyNone);
     if H.Size<>4 then
       halt(2);