Test suite results for test file test/tcase1.pp

Test run data :

Free Pascal Compiler Test Suite Results

View Test suite results

Please specify search criteria:
File:
Operating system:
Processor:
Version
Date
Submitter
Machine
Comment
Limit
Cond
Category
Only failed tests
Hide skipped tests
List all tests

Test file "test/tcase1.pp" information:

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

Detailed test run results:

Record count: 50

Total = 50

OK=50 Percentage= 100.00

Result type Cat. Count Percentage First date Last Date
Successfully run 50 100.0 2024/05/21 02:33:00 24 2024/05/21 06:21:00 0
i386 5 10.0 2024/05/21 03:08:00 33 2024/05/21 06:01:00 28
m68k 2 4.0 2024/05/21 05:47:00 63 2024/05/21 06:07:00 190
powerpc 3 6.0 2024/05/21 06:13:00 42 2024/05/21 06:21:00 0
arm 2 4.0 2024/05/21 05:29:00 69 2024/05/21 05:53:00 67
x86_64 16 32.0 2024/05/21 02:33:00 24 2024/05/21 06:19:00 0
powerpc64 11 22.0 2024/05/21 05:13:00 105 2024/05/21 05:49:00 112
mips 3 6.0 2024/05/21 04:05:00 47 2024/05/21 06:16:00 240
aarch64 8 16.0 2024/05/21 05:20:00 46 2024/05/21 06:15:00 41
linux 32 64.0 2024/05/21 02:33:00 24 2024/05/21 06:21:00 0
win32 1 2.0 2024/05/21 06:01:00 28 2024/05/21 06:01:00 28
go32v2 1 2.0 2024/05/21 05:41:00 55 2024/05/21 05:41:00 55
solaris 10 20.0 2024/05/21 05:55:00 29 2024/05/21 06:19:00 0
darwin 6 12.0 2024/05/21 05:42:00 24 2024/05/21 06:15:00 41
3.3.1 22 44.0 2024/05/21 02:33:00 24 2024/05/21 06:21:00 0
3.2.3 28 56.0 2024/05/21 03:08:00 33 2024/05/21 06:19:00 0

Source:

program test_case;
function case1(Val : byte) : char;
begin
  case Val of
    0..25 : case1:=chr(Val + ord('A'));
    26..51: case1:=chr(Val + ord('a') - 26);
    52..61: case1:=chr(Val + ord('0') - 52);
    62    : case1:='+';
    63    : case1:='/';
  else
    case1:='$';
  end;
end;

function case2(Val : integer) : integer;
begin
  case Val of
    -1      : case2:=1;
    32765..
    32767   : case2:=2;
  else
    case2:=-1;
  end;
end;

function case3(Val : integer) : integer;
begin
  case Val of
    -32768..
    -32766 : case3:=1;
    0..10  : case3:=2;
  else
    case3:=-1;
  end;
end;

var
  error: boolean;

begin
  { The correct outputs should be:
    F $
    2 2
    1 2 2
  }
  error := false;
  writeln(case1(5), ' ', case1(255),' (should be: F $)');
  error := (case1(5) <> 'F') or (case1(255) <> '$');
  writeln(case2(32765), ' ', case2(32767),' (should be: 2 2)');
  error := error or (case2(32765) <> 2) or (case2(32767) <> 2);
  writeln(case3(-32768),' ',case3(0), ' ',case3(5),' (should be: 1 2 2)');
  error := error or (case3(-32768) <> 1) or (case3(0) <> 2) or
           (case3(5) <> 2);
  if error then
    halt(1);
end.

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