Test suite results for test file test/tset1.pp

Test run data :

Run ID:
Operating system: aix
Processor: powerpc64
Version: 3.2.3
Fails/OK/Total: 83/7826/7909
Version: 3.2.3
Full version: 3.2.3-1373-gae0fe8a6a0
Comment: -Fl/opt/freeware/lib -Fd
Machine: power-aix
Category: 1
SVN revisions: fdf93c5b29:c17a0e20f5:ae0fe8a6a0:d1c29e6cb9
Submitter: pierre
Date: 2024/04/19 10:44:00 <> 2024/04/09
Previous run: 934298
Next run: 935634

Hide skipped tests

Hide successful tests

Test file "test/tset1.pp" information:

t_id 82
t_adddate 2003/10/03
t_result 0
t_knownrunerror 0

Detailed test run results:

tr_idruntr_oktr_skiptr_result
443595400934956TrueFalseSuccessfully run

Record count: 1

No log of 934956.

Source:

{
  $Id: tset1.pp,v 1.3 2000/11/30 22:38:21 peter Exp $

  Program to test set functions
}

{$define FPC_HAS_SET_INEQUALITIES}

program TestSet;

Procedure InitMSTimer;
begin
end;


{Get MS Timer}
Function MSTimer:longint;
begin
  MSTimer:=0;
end;


const
  Lval=2000;
VAR Box1, Box2:         ARRAY [0..255] OF BYTE;
    OneWOTwo, TwoWOOne,
    UnionSet, InterSet,
    Set1, Set2, Set3:   SET OF BYTE;
    K, MaxNr, L,
    N, Low, Hi:         INTEGER;
    Start:              LONGINT;

begin
   WriteLn ('Set operators functional and speed test');
   WriteLn;

   RandSeed := 17;

   for L := 0 TO 255 DO begin
      Box1 [L] := L;
   end;
   MaxNr := 255;
   for L := 0 TO 255 DO begin
      K := Random (MaxNr+1);
      Box2 [L] := Box1 [K];
      Box1 [K] := Box1 [MaxNr];
      Dec (MaxNr);
   end;

   Start :=MSTimer;

   Set1 := [];
   Set2 := [];
   for L := 0 TO 255 DO begin
      Set1 := Set1 + [Box2 [L]];
      if NOT (Box2 [L] IN Set1) then begin
         WriteLn ('error in AddElem or InSet functions');
         Halt;
         end;
      Set2 := Set2 + [Box2 [L]] + [];
   end;

{$ifdef FPC_HAS_SET_INEQUALITIES }
   if (Set1 <> Set2) OR (NOT (Set1 <= Set2)) OR (NOT (Set1 >= Set2)) then begin
{$else FPC_HAS_SET_INEQUALITIES }
   if (Set1 <> Set2) then begin
{$endif FPC_HAS_SET_INEQUALITIES }
      WriteLn ('error in relational operators 1');
      Halt;
      end;

   for L := 0 TO 255 DO begin
      Set1 := Set1 - [Box2 [L]];
      if Box2 [L] IN Set1 then begin
         WriteLn ('error in set difference 1');
         Halt;
         end;
   end;

   if Set1 <> [] then begin
      WriteLn ('error in set difference 2');
      Halt;
      end;

   for L := 1 TO LVal DO begin
      REPEAT
         Low := Random (256);
         Hi  := Random (256);
      UNTIL Low <= Hi;

      Set1 := [];
      Set1 := Set1 + [Low..Hi];
      for K := 0 TO 255 DO begin
         if (K IN Set1) AND ((K < Low) OR (K > Hi)) then begin
            WriteLn ('wrong set inclusion in add range');
            Halt;
            end;
         if (NOT (K IN Set1)) AND ((K >= Low) AND (K <= Hi)) then begin
            WriteLn ('wrong set exclusion in add range');
            Halt;
            end;
      end;
   end;

   for L := 1 TO LVal DO begin
      Set1 := [];
      Set2 := [];

      for K := 1 TO 10 DO begin
         Low := Random (256);
         Hi  := Random (256);
         Set2:= Set1 + [Low..Hi];
{$ifdef FPC_HAS_SET_INEQUALITIES }
         if (Set1 >= Set2) AND (Set1 <> Set2) then begin
{$else FPC_HAS_SET_INEQUALITIES }
         if (Set1 <> Set2) then begin
{$endif FPC_HAS_SET_INEQUALITIES }
            WriteLn ('error in relational operators 2');
            Halt;
            end;
{$ifdef FPC_HAS_SET_INEQUALITIES }
         if NOT (Set1 <= Set2) then begin
            WriteLn ('error in relational operators 3');
            Halt;
            end;
{$endif FPC_HAS_SET_INEQUALITIES }
         Set1 := Set2;

      end;
   end;

   for L := 1 TO LVal DO begin
      Set1 := [];
      for K := 1 TO 10 DO begin
         Low := Random (256);
         Hi  := Random (256);
         Set1:= Set1 + [Low..Hi];
      end;
      Set2 := [];
      for K := 1 TO 10 DO begin
         Low := Random (256);
         Hi  := Random (256);
         Set2:= Set2 + [Low..Hi];
      end;

      OneWOTwo := Set1 - Set2;
      TwoWOOne := Set2 - Set1;
      InterSet := Set1 * Set2;
      UnionSet := Set1 + Set2;

      if InterSet <> (Set2 * Set1) then begin
         WriteLn ('error in set difference');
         Halt;
         end;

      if (InterSet + OneWOTwo) <> Set1 then begin
         WriteLn ('error in set difference or intersection');
         Halt;
         end;

      if (InterSet + TwoWOOne) <> Set2 then begin
         WriteLn ('error in set difference or intersection');
         Halt;
         end;

      if (OneWOTwo + TwoWOOne + InterSet) <> UnionSet then begin
         WriteLn ('error in set union, intersection or difference');
         Halt;
         end;

   end;
  Start:=MSTimer-Start;
  WriteLn('Set test completes in ',Start,' ms');
end.

Link to SVN view of test/tset1.pp source.