Test suite results for test file test/trange3.pp

Test run data :

Run ID:
Operating system: linux
Processor: powerpc
Version: 3.2.3
Fails/OK/Total: 6/3897/3903
Version: 3.2.3
Full version: 3.2.3-1374-g849fbd722c-unpushed
Comment: -O4 -Xd -Fl/usr/lib32 -Fd -Fl/usr/lib/gcc/powerpc64-linux-gnu/13/32 -Fd
Machine: gcc203
Category: 1
SVN revisions: fdf93c5b29:849fbd722c:ae0fe8a6a0:d1c29e6cb9
Submitter: pierre
Date: 2024/04/19 11:14:00 <> 2024/04/10
Previous run: 934305
Next run: 935646

Hide skipped tests

Hide successful tests

Test file "test/trange3.pp" information:

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

Detailed test run results:

tr_idruntr_oktr_skiptr_result
443693271934971TrueFalseSuccessfully run

Record count: 1

No log of 934971.

Source:

{$mode objfpc}
uses sysutils;

{$r+}

var
  a1: array[-5..6] of byte;
  a2: array[-12..-1] of byte;
  a3: array[0..6] of byte;
  a4: array[1..12] of byte;

  c: cardinal;
  l: longint;
  b: byte;
  finalerror: boolean;

function check_longint(l: longint; res1, res2, res3, res4: boolean): boolean;
var
  caught,
  error: boolean;
begin
  result := false;

  caught := false;
  try
    b := a1[l];
  except
    caught := true;
  end;
  error := caught <> res1;
  if error then writeln('long 1 failed for ',l);
  result := result or error;

  caught := false;
  try
    b := a2[l];
  except
    caught := true;
  end;
  error := caught <> res2;
  if error then writeln('long 2 failed for ',l);
  result := result or error;

  caught := false;
  try
    b := a3[l];
  except
    caught := true;
  end;
  error := caught <> res3;
  if error then writeln('long 3 failed for ',l);
  result := result or error;

  caught := false;
  try
    b := a4[l];
  except
    caught := true;
  end;
  error := caught <> res4;
  if error then writeln('long 4 failed for ',l);
  result := result or error;
  writeln;
end;

function check_cardinal(l: cardinal; res1, res2, res3, res4: boolean): boolean;
var
  caught,
  error: boolean;
begin
  result := false;

  caught := false;
  try
    b := a1[l];
  except
    caught := true;
  end;
  error := caught <> res1;
  if error then writeln('card 1 failed for ',l);
  result := result or error;

  caught := false;
  try
    b := a2[l];
  except
    caught := true;
  end;
  error := caught <> res2;
  if error then writeln('card 2 failed for ',l);
  result := result or error;

  caught := false;
  try
    b := a3[l];
  except
    caught := true;
  end;
  error := caught <> res3;
  if error then writeln('card 3 failed for ',l);
  result := result or error;

  caught := false;
  try
    b := a4[l];
  except
    caught := true;
  end;
  error := caught <> res4;
  if error then writeln('card 4 failed for ',l);
  result := result or error;
  writeln;
end;


begin
  finalerror :=
    check_longint(-1,false,false,true,true);
  finalerror :=
    check_longint(-6,true,false,true,true) or finalerror;
  finalerror :=
    check_longint(0,false,true,false,true) or finalerror;
  finalerror :=
    check_cardinal(0,false,true,false,true);
  finalerror :=
    check_cardinal(cardinal($ffffffff),true,true,true,true) or finalerror;
  finalerror :=
    check_cardinal(5,false,true,false,false) or finalerror;
  if finalerror then
    begin
      writeln('Still errors in range checking for array indexes');
      halt(1);
    end;
end.

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