123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631 |
- type
- { TUInt16Bit1Test }
- TUInt16Bit1Test = class(TUInt16DivTest)
- protected
- function GetDivisor: Word; override;
- procedure DoTestIteration(Iteration: Integer); override;
- public
- function TestTitle: shortstring; override;
- end;
- { TUInt16Bit1ModTest }
- TUInt16Bit1ModTest = class(TUInt16ModTest)
- protected
- function GetDivisor: Word; override;
- procedure DoTestIteration(Iteration: Integer); override;
- public
- function TestTitle: shortstring; override;
- end;
- { TUInt16Bit2Test }
- TUInt16Bit2Test = class(TUInt16DivTest)
- protected
- function GetDivisor: Word; override;
- procedure DoTestIteration(Iteration: Integer); override;
- public
- function TestTitle: shortstring; override;
- end;
- { TUInt16Bit2ModTest }
- TUInt16Bit2ModTest = class(TUInt16ModTest)
- protected
- function GetDivisor: Word; override;
- procedure DoTestIteration(Iteration: Integer); override;
- public
- function TestTitle: shortstring; override;
- end;
- { TUInt16Bit3Test }
- TUInt16Bit3Test = class(TUInt16DivTest)
- protected
- function GetDivisor: Word; override;
- procedure DoTestIteration(Iteration: Integer); override;
- public
- function TestTitle: shortstring; override;
- end;
- { TUInt16Bit3ModTest }
- TUInt16Bit3ModTest = class(TUInt16ModTest)
- protected
- function GetDivisor: Word; override;
- procedure DoTestIteration(Iteration: Integer); override;
- public
- function TestTitle: shortstring; override;
- end;
- { TUInt16Bit7Test }
- TUInt16Bit7Test = class(TUInt16DivTest)
- protected
- function GetDivisor: Word; override;
- procedure DoTestIteration(Iteration: Integer); override;
- public
- function TestTitle: shortstring; override;
- end;
- { TUInt16Bit7ModTest }
- TUInt16Bit7ModTest = class(TUInt16ModTest)
- protected
- function GetDivisor: Word; override;
- procedure DoTestIteration(Iteration: Integer); override;
- public
- function TestTitle: shortstring; override;
- end;
- { TUInt16Bit10Test }
- TUInt16Bit10Test = class(TUInt16DivTest)
- protected
- function GetDivisor: Word; override;
- procedure DoTestIteration(Iteration: Integer); override;
- public
- function TestTitle: shortstring; override;
- end;
- { TUInt16Bit10ModTest }
- TUInt16Bit10ModTest = class(TUInt16ModTest)
- protected
- function GetDivisor: Word; override;
- procedure DoTestIteration(Iteration: Integer); override;
- public
- function TestTitle: shortstring; override;
- end;
- { TUInt16Bit100Test }
- TUInt16Bit100Test = class(TUInt16DivTest)
- protected
- function GetDivisor: Word; override;
- procedure DoTestIteration(Iteration: Integer); override;
- public
- function TestTitle: shortstring; override;
- end;
- { TUInt16Bit100ModTest }
- TUInt16Bit100ModTest = class(TUInt16ModTest)
- protected
- function GetDivisor: Word; override;
- procedure DoTestIteration(Iteration: Integer); override;
- public
- function TestTitle: shortstring; override;
- end;
- { TUInt16Bit1000Test }
- const
- FU16_1000Input: array[$0..$F] of Word =
- (0, 1, 999, 1000, 1001, 1999, 2000, 2001,
- 64999, 65000, 65001,
- $7FFE, $7FFF, $8000, $8001, $FFFF);
- type
- TUInt16Bit1000Test = class(TUInt16DivTest)
- protected
- function GetDivisor: Word; override;
- procedure DoTestIteration(Iteration: Integer); override;
- public
- function TestTitle: shortstring; override;
- end;
- { TUInt16Bit1000ModTest }
- TUInt16Bit1000ModTest = class(TUInt16ModTest)
- protected
- function GetDivisor: Word; override;
- procedure DoTestIteration(Iteration: Integer); override;
- public
- function TestTitle: shortstring; override;
- end;
- { TUInt16Bit1Test }
- function TUInt16Bit1Test.TestTitle: shortstring;
- begin
- Result := 'Unsigned 16-bit division by 1';
- end;
- function TUInt16Bit1Test.GetDivisor: Word;
- begin
- Result := 1;
- end;
- procedure TUInt16Bit1Test.DoTestIteration(Iteration: Integer);
- var
- Numerator, Answer: Word;
- Index, X: Integer;
- begin
- Index := Iteration and $FF;
- case Index of
- 253:
- Numerator := 65533;
- 254:
- Numerator := 65534;
- 255:
- Numerator := 65535;
- else
- Numerator := Word(Index);
- end;
- FInputArray[Index] := Numerator;
- for X := 0 to INTERNAL_LOOPS - 1 do
- Answer := Numerator div 1;
- FResultArray[Index] := Answer;
- end;
- { TUInt16Bit1Test }
- function TUInt16Bit1ModTest.TestTitle: shortstring;
- begin
- Result := 'Unsigned 16-bit modulus by 1';
- end;
- function TUInt16Bit1ModTest.GetDivisor: Word;
- begin
- Result := 1;
- end;
- procedure TUInt16Bit1ModTest.DoTestIteration(Iteration: Integer);
- var
- Numerator, Answer: Word;
- Index, X: Integer;
- begin
- Index := Iteration and $FF;
- case Index of
- 253:
- Numerator := 65533;
- 254:
- Numerator := 65534;
- 255:
- Numerator := 65535;
- else
- Numerator := Word(Index);
- end;
- FInputArray[Index] := Numerator;
- for X := 0 to INTERNAL_LOOPS - 1 do
- Answer := Numerator mod 1;
- FResultArray[Index] := Answer;
- end;
- { TUInt16Bit2Test }
- function TUInt16Bit2Test.TestTitle: shortstring;
- begin
- Result := 'Unsigned 16-bit division by 2';
- end;
- function TUInt16Bit2Test.GetDivisor: Word;
- begin
- Result := 2;
- end;
- procedure TUInt16Bit2Test.DoTestIteration(Iteration: Integer);
- var
- Numerator, Answer: Word;
- Index, X: Integer;
- begin
- Index := Iteration and $FF;
- case Index of
- 253:
- Numerator := 65533;
- 254:
- Numerator := 65534;
- 255:
- Numerator := 65535;
- else
- Numerator := Word(Index);
- end;
- FInputArray[Index] := Numerator;
- for X := 0 to INTERNAL_LOOPS - 1 do
- Answer := Numerator div 2;
- FResultArray[Index] := Answer;
- end;
- { TUInt16Bit2ModTest }
- function TUInt16Bit2ModTest.TestTitle: shortstring;
- begin
- Result := 'Unsigned 16-bit modulus by 2';
- end;
- function TUInt16Bit2ModTest.GetDivisor: Word;
- begin
- Result := 2;
- end;
- procedure TUInt16Bit2ModTest.DoTestIteration(Iteration: Integer);
- var
- Numerator, Answer: Word;
- Index, X: Integer;
- begin
- Index := Iteration and $FF;
- case Index of
- 253:
- Numerator := 65533;
- 254:
- Numerator := 65534;
- 255:
- Numerator := 65535;
- else
- Numerator := Word(Index);
- end;
- FInputArray[Index] := Numerator;
- for X := 0 to INTERNAL_LOOPS - 1 do
- Answer := Numerator mod 2;
- FResultArray[Index] := Answer;
- end;
- { TUInt16Bit3Test }
- function TUInt16Bit3Test.TestTitle: shortstring;
- begin
- Result := 'Unsigned 16-bit division by 3';
- end;
- function TUInt16Bit3Test.GetDivisor: Word;
- begin
- Result := 3;
- end;
- procedure TUInt16Bit3Test.DoTestIteration(Iteration: Integer);
- var
- Numerator, Answer: Word;
- Index, X: Integer;
- begin
- Index := Iteration and $FF;
- case Index of
- 253:
- Numerator := 65533;
- 254:
- Numerator := 65534;
- 255:
- Numerator := 65535;
- else
- Numerator := Word(Index);
- end;
- FInputArray[Index] := Numerator;
- for X := 0 to INTERNAL_LOOPS - 1 do
- Answer := Numerator div 3;
- FResultArray[Index] := Answer;
- end;
- { TUInt16Bit3ModTest }
- function TUInt16Bit3ModTest.TestTitle: shortstring;
- begin
- Result := 'Unsigned 16-bit modulus by 3';
- end;
- function TUInt16Bit3ModTest.GetDivisor: Word;
- begin
- Result := 3;
- end;
- procedure TUInt16Bit3ModTest.DoTestIteration(Iteration: Integer);
- var
- Numerator, Answer: Word;
- Index, X: Integer;
- begin
- Index := Iteration and $FF;
- case Index of
- 253:
- Numerator := 65533;
- 254:
- Numerator := 65534;
- 255:
- Numerator := 65535;
- else
- Numerator := Word(Index);
- end;
- FInputArray[Index] := Numerator;
- for X := 0 to INTERNAL_LOOPS - 1 do
- Answer := Numerator mod 3;
- FResultArray[Index] := Answer;
- end;
- { TUInt16Bit7Test }
- function TUInt16Bit7Test.TestTitle: shortstring;
- begin
- Result := 'Unsigned 16-bit division by 7';
- end;
- function TUInt16Bit7Test.GetDivisor: Word;
- begin
- Result := 7;
- end;
- procedure TUInt16Bit7Test.DoTestIteration(Iteration: Integer);
- var
- Numerator, Answer: Word;
- Index, X: Integer;
- begin
- Index := Iteration and $FF;
- case Index of
- 253:
- Numerator := 65533;
- 254:
- Numerator := 65534;
- 255:
- Numerator := 65535;
- else
- Numerator := Word(Index);
- end;
- FInputArray[Index] := Numerator;
- for X := 0 to INTERNAL_LOOPS - 1 do
- Answer := Numerator div 7;
- FResultArray[Index] := Answer;
- end;
- { TUInt16Bit7ModTest }
- function TUInt16Bit7ModTest.TestTitle: shortstring;
- begin
- Result := 'Unsigned 16-bit modulus by 7';
- end;
- function TUInt16Bit7ModTest.GetDivisor: Word;
- begin
- Result := 7;
- end;
- procedure TUInt16Bit7ModTest.DoTestIteration(Iteration: Integer);
- var
- Numerator, Answer: Word;
- Index, X: Integer;
- begin
- Index := Iteration and $FF;
- case Index of
- 253:
- Numerator := 65533;
- 254:
- Numerator := 65534;
- 255:
- Numerator := 65535;
- else
- Numerator := Word(Index);
- end;
- FInputArray[Index] := Numerator;
- for X := 0 to INTERNAL_LOOPS - 1 do
- Answer := Numerator mod 7;
- FResultArray[Index] := Answer;
- end;
- { TUInt16Bit10Test }
- function TUInt16Bit10Test.TestTitle: shortstring;
- begin
- Result := 'Unsigned 16-bit division by 10';
- end;
- function TUInt16Bit10Test.GetDivisor: Word;
- begin
- Result := 10;
- end;
- procedure TUInt16Bit10Test.DoTestIteration(Iteration: Integer);
- var
- Numerator, Answer: Word;
- Index, X: Integer;
- begin
- Index := Iteration and $FF;
- case Index of
- 253:
- Numerator := 65533;
- 254:
- Numerator := 65534;
- 255:
- Numerator := 65535;
- else
- Numerator := Word(Index);
- end;
- FInputArray[Index] := Numerator;
- for X := 0 to INTERNAL_LOOPS - 1 do
- Answer := Numerator div 10;
- FResultArray[Index] := Answer;
- end;
- { TUInt16Bit10ModTest }
- function TUInt16Bit10ModTest.TestTitle: shortstring;
- begin
- Result := 'Unsigned 16-bit modulus by 10';
- end;
- function TUInt16Bit10ModTest.GetDivisor: Word;
- begin
- Result := 10;
- end;
- procedure TUInt16Bit10ModTest.DoTestIteration(Iteration: Integer);
- var
- Numerator, Answer: Word;
- Index, X: Integer;
- begin
- Index := Iteration and $FF;
- case Index of
- 253:
- Numerator := 65533;
- 254:
- Numerator := 65534;
- 255:
- Numerator := 65535;
- else
- Numerator := Word(Index);
- end;
- FInputArray[Index] := Numerator;
- for X := 0 to INTERNAL_LOOPS - 1 do
- Answer := Numerator mod 10;
- FResultArray[Index] := Answer;
- end;
- { TUInt16Bit100Test }
- function TUInt16Bit100Test.TestTitle: shortstring;
- begin
- Result := 'Unsigned 16-bit division by 100';
- end;
- function TUInt16Bit100Test.GetDivisor: Word;
- begin
- Result := 100;
- end;
- procedure TUInt16Bit100Test.DoTestIteration(Iteration: Integer);
- var
- Numerator, Answer: Word;
- Index, X: Integer;
- begin
- Index := Iteration and $FF;
- case Index of
- 253:
- Numerator := 65533;
- 254:
- Numerator := 65534;
- 255:
- Numerator := 65535;
- else
- Numerator := Word(Index);
- end;
- FInputArray[Index] := Numerator;
- for X := 0 to INTERNAL_LOOPS - 1 do
- Answer := Numerator div 100;
- FResultArray[Index] := Answer;
- end;
- { TUInt16Bit100ModTest }
- function TUInt16Bit100ModTest.TestTitle: shortstring;
- begin
- Result := 'Unsigned 16-bit modulus by 100';
- end;
- function TUInt16Bit100ModTest.GetDivisor: Word;
- begin
- Result := 100;
- end;
- procedure TUInt16Bit100ModTest.DoTestIteration(Iteration: Integer);
- var
- Numerator, Answer: Word;
- Index, X: Integer;
- begin
- Index := Iteration and $FF;
- case Index of
- 253:
- Numerator := 65533;
- 254:
- Numerator := 65534;
- 255:
- Numerator := 65535;
- else
- Numerator := Word(Index);
- end;
- FInputArray[Index] := Numerator;
- for X := 0 to INTERNAL_LOOPS - 1 do
- Answer := Numerator mod 100;
- FResultArray[Index] := Answer;
- end;
- { TUInt16Bit1000Test }
- function TUInt16Bit1000Test.TestTitle: shortstring;
- begin
- Result := 'Unsigned 16-bit division by 1,000';
- end;
- function TUInt16Bit1000Test.GetDivisor: Word;
- begin
- Result := 1000;
- end;
- procedure TUInt16Bit1000Test.DoTestIteration(Iteration: Integer);
- var
- Numerator, Answer: Word;
- Index, X: Integer;
- begin
- Index := Iteration and $FF;
- Numerator := FU16_1000Input[Index and $F];
- FInputArray[Index] := Numerator;
- for X := 0 to INTERNAL_LOOPS - 1 do
- Answer := Numerator div 1000;
- FResultArray[Index] := Answer;
- end;
- { TUInt16Bit1000ModTest }
- function TUInt16Bit1000ModTest.TestTitle: shortstring;
- begin
- Result := 'Unsigned 16-bit modulus by 1,000';
- end;
- function TUInt16Bit1000ModTest.GetDivisor: Word;
- begin
- Result := 1000;
- end;
- procedure TUInt16Bit1000ModTest.DoTestIteration(Iteration: Integer);
- var
- Numerator, Answer: Word;
- Index, X: Integer;
- begin
- Index := Iteration and $FF;
- Numerator := FU16_1000Input[Index and $F];
- FInputArray[Index] := Numerator;
- for X := 0 to INTERNAL_LOOPS - 1 do
- Answer := Numerator mod 1000;
- FResultArray[Index] := Answer;
- end;
|