Browse Source

+ number of files to open can be specified by command line parameter

pierre 26 years ago
parent
commit
cf9008e103
1 changed files with 12 additions and 2 deletions
  1. 12 2
      tests/webtbs/tbug754.pp

+ 12 - 2
tests/webtbs/tbug754.pp

@@ -6,8 +6,10 @@ const
 var
 var
    f : array [1..MaxOpenTest] of text;
    f : array [1..MaxOpenTest] of text;
    i,count : longint;
    i,count : longint;
+   error : word;
    s : string;
    s : string;
    storeexit : pointer;
    storeexit : pointer;
+   Max : longint;
 
 
 procedure Errorexit;
 procedure Errorexit;
 begin
 begin
@@ -44,8 +46,16 @@ end;
 begin
 begin
   StoreExit:=exitproc;
   StoreExit:=exitproc;
   ExitProc:=@ErrorExit;
   ExitProc:=@ErrorExit;
+  Max:=MaxOpenTest;
+  if paramcount>0 then
+    begin
+      val(paramstr(1),count,error);
+      if error = 0 then
+        Max:=count;
+      count:=0;
+    end;
 
 
-  for i:=1 to MaxOpenTest do
+  for i:=1 to Max do
     begin
     begin
       str(i,s);
       str(i,s);
       s:='file'+s+'.tmp';
       s:='file'+s+'.tmp';
@@ -57,6 +67,6 @@ begin
       { no closing so they are finally all open }
       { no closing so they are finally all open }
     end;
     end;
 
 
-  for i:=MaxOpenTest downto 1 do
+  for i:=Max downto 1 do
     close(f[i]);
     close(f[i]);
 end.
 end.