123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208 |
- type
- { TSInt32Bit1Test }
- TSInt32Bit1Test = class(TSInt32DivTest)
- protected
- function GetDivisor: Integer; override;
- procedure DoTestIteration(Iteration: Integer); override;
- public
- function TestTitle: shortstring; override;
- end;
- { TSInt32Bit1ModTest }
- TSInt32Bit1ModTest = class(TSInt32ModTest)
- protected
- function GetDivisor: Integer; override;
- procedure DoTestIteration(Iteration: Integer); override;
- public
- function TestTitle: shortstring; override;
- end;
- { TSInt32Bit100Test }
- TSInt32Bit100Test = class(TSInt32DivTest)
- protected
- function GetDivisor: Integer; override;
- procedure DoTestIteration(Iteration: Integer); override;
- public
- function TestTitle: shortstring; override;
- end;
- { TSInt32Bit100ModTest }
- TSInt32Bit100ModTest = class(TSInt32ModTest)
- protected
- function GetDivisor: Integer; override;
- procedure DoTestIteration(Iteration: Integer); override;
- public
- function TestTitle: shortstring; override;
- end;
- { TSInt32Bit1Test }
- function TSInt32Bit1Test.TestTitle: shortstring;
- begin
- Result := 'Signed 32-bit division by 1';
- end;
- function TSInt32Bit1Test.GetDivisor: Integer;
- begin
- Result := 1;
- end;
- procedure TSInt32Bit1Test.DoTestIteration(Iteration: Integer);
- var
- Numerator, Answer: Integer;
- Index, X: Integer;
- begin
- Index := Iteration and $FF;
- case Index of
- 0:
- Numerator := -2147483648;
- 1:
- Numerator := -2147483600;
- 2:
- Numerator := -2147483599;
- 253:
- Numerator := 2147483599;
- 254:
- Numerator := 2147483600;
- 255:
- Numerator := 2147483647;
- else
- Numerator := Index - 128;
- end;
- FInputArray[Index] := Numerator;
- for X := 0 to INTERNAL_LOOPS - 1 do
- Answer := Numerator div 1;
-
- FResultArray[Index] := Answer;
- end;
- { TSInt32Bit1ModTest }
- function TSInt32Bit1ModTest.TestTitle: shortstring;
- begin
- Result := 'Signed 32-bit modulus by 1';
- end;
- function TSInt32Bit1ModTest.GetDivisor: Integer;
- begin
- Result := 1;
- end;
- procedure TSInt32Bit1ModTest.DoTestIteration(Iteration: Integer);
- var
- Numerator, Answer: Integer;
- Index, X: Integer;
- begin
- Index := Iteration and $FF;
- case Index of
- 0:
- Numerator := -2147483648;
- 1:
- Numerator := -2147483600;
- 2:
- Numerator := -2147483599;
- 253:
- Numerator := 2147483599;
- 254:
- Numerator := 2147483600;
- 255:
- Numerator := 2147483647;
- else
- Numerator := Index - 128;
- end;
- FInputArray[Index] := Numerator;
- for X := 0 to INTERNAL_LOOPS - 1 do
- Answer := Numerator mod 1;
-
- FResultArray[Index] := Answer;
- end;
- { TSInt32Bit100Test }
- function TSInt32Bit100Test.TestTitle: shortstring;
- begin
- Result := 'Signed 32-bit division by 100';
- end;
- function TSInt32Bit100Test.GetDivisor: Integer;
- begin
- Result := 100;
- end;
- procedure TSInt32Bit100Test.DoTestIteration(Iteration: Integer);
- var
- Numerator, Answer: Integer;
- Index, X: Integer;
- begin
- Index := Iteration and $FF;
- case Index of
- 0:
- Numerator := -2147483648;
- 1:
- Numerator := -2147483600;
- 2:
- Numerator := -2147483599;
- 253:
- Numerator := 2147483599;
- 254:
- Numerator := 2147483600;
- 255:
- Numerator := 2147483647;
- else
- Numerator := Index - 128;
- end;
- FInputArray[Index] := Numerator;
- for X := 0 to INTERNAL_LOOPS - 1 do
- Answer := Numerator div 100;
-
- FResultArray[Index] := Answer;
- end;
- { TSInt32Bit100ModTest }
- function TSInt32Bit100ModTest.TestTitle: shortstring;
- begin
- Result := 'Signed 32-bit modulus by 100';
- end;
- function TSInt32Bit100ModTest.GetDivisor: Integer;
- begin
- Result := 100;
- end;
- procedure TSInt32Bit100ModTest.DoTestIteration(Iteration: Integer);
- var
- Numerator, Answer: Integer;
- Index, X: Integer;
- begin
- Index := Iteration and $FF;
- case Index of
- 0:
- Numerator := -2147483648;
- 1:
- Numerator := -2147483600;
- 2:
- Numerator := -2147483599;
- 253:
- Numerator := 2147483599;
- 254:
- Numerator := 2147483600;
- 255:
- Numerator := 2147483647;
- else
- Numerator := Index - 128;
- end;
- FInputArray[Index] := Numerator;
- for X := 0 to INTERNAL_LOOPS - 1 do
- Answer := Numerator mod 100;
-
- FResultArray[Index] := Answer;
- end;
|