Browse Source

Use Cardinal type of FTimeout field and change parameter type accordingly

Pierre Muller 2 months ago
parent
commit
a58def8baa
1 changed files with 7 additions and 7 deletions
  1. 7 7
      packages/rtl-objpas/tests/utcfpmonitor.pas

+ 7 - 7
packages/rtl-objpas/tests/utcfpmonitor.pas

@@ -37,9 +37,9 @@ Type
   Private
     FObj : TTestObject;
     FOperation : TThreadOperation;
-    FTimeout : Integer;
+    FTimeout : Cardinal;
     FID : Integer;
-    Constructor Create(aObj : TTestObject; aOperation : TThreadOperation; aId,aTimeout : Integer; aOnFree : TNotifyEvent);
+    Constructor Create(aObj : TTestObject; aOperation : TThreadOperation; aId : Integer; aTimeout : Cardinal; aOnFree : TNotifyEvent);
   Public
     Procedure Execute; override;
   end;
@@ -50,11 +50,11 @@ Type
     FThrdCount : Integer;
     FObj : Array[1..MaxObjCount] of  TTestObject;
     FThrd : Array[1..MaxThrdCount] of TThread;
-    function DoCreateThread(aObj: TTestObject; aOperation: TThreadOperation; aId, aTimeout: Integer): TTestThread;
+    function DoCreateThread(aObj: TTestObject; aOperation: TThreadOperation; aId: Integer; aTimeout: Cardinal): TTestThread;
     class procedure AssertEquals(Msg: String; aExpected, aActual: TThreadOperation); overload;
     function GetObj(AIndex: Integer): TTestObject;
     procedure ThreadDone(Sender : TObject);
-    procedure WaitForAllThreads(aTimeOut: Integer=0);
+    procedure WaitForAllThreads(aTimeOut: Cardinal=0);
   public
     Procedure Setup; override;
     Procedure TearDown; override;
@@ -76,7 +76,7 @@ Uses TypInfo;
 
 { TTestThread }
 
-constructor TTestThread.Create(aObj: TTestObject; aOperation: TThreadOperation; aId,aTimeout: Integer; aOnFree : TNotifyEvent);
+constructor TTestThread.Create(aObj: TTestObject; aOperation: TThreadOperation; aId: Integer;aTimeout: Cardinal; aOnFree : TNotifyEvent);
 begin
   FObj:=aObj;
   FOperation:=aOperation;
@@ -170,7 +170,7 @@ begin
   {$IFDEF DEBUG_MONITOR}Writeln(StdErr,GetTickCount64,': Thread ',GetCurrentThreadID,' End done executing. Threads still active: ',aCount);{$ENDIF}
 end;
 
-procedure TTestMonitorSupport.WaitForAllThreads(aTimeOut : Integer = 0);
+procedure TTestMonitorSupport.WaitForAllThreads(aTimeOut : Cardinal = 0);
 
 var
   I : Integer;
@@ -242,7 +242,7 @@ begin
     AssertNull('Thrd '+IntToStr(i),FThrd[I]);
 end;
 
-function TTestMonitorSupport.DoCreateThread(aObj: TTestObject; aOperation: TThreadOperation; aId, aTimeout: Integer): TTestThread;
+function TTestMonitorSupport.DoCreateThread(aObj: TTestObject; aOperation: TThreadOperation; aId : Integer; aTimeout: Cardinal): TTestThread;
 
 begin
   Inc(FThrdCount);