Test suite results for test file test/trange1.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/trange1.pp" information:

t_id 73
t_version 1.1
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/17 11:04:00 38 2024/05/17 16:28:00 32
i386 10 20.0 2024/05/17 11:29:00 44 2024/05/17 12:24:00 45
sparc 1 2.0 2024/05/17 12:01:00 74 2024/05/17 12:01:00 74
powerpc 1 2.0 2024/05/17 11:30:00 242 2024/05/17 11:30:00 242
x86_64 26 52.0 2024/05/17 11:10:00 26 2024/05/17 14:42:00 39
powerpc64 2 4.0 2024/05/17 11:34:00 242 2024/05/17 11:39:00 59
mips 1 2.0 2024/05/17 11:21:00 241 2024/05/17 11:21:00 241
aarch64 7 14.0 2024/05/17 11:04:00 38 2024/05/17 16:28:00 32
sparc64 1 2.0 2024/05/17 12:19:00 173 2024/05/17 12:19:00 173
riscv64 1 2.0 2024/05/17 11:56:00 31 2024/05/17 11:56:00 31
linux 35 70.0 2024/05/17 11:04:00 38 2024/05/17 12:48:00 22
solaris 10 20.0 2024/05/17 11:29:00 44 2024/05/17 12:24:00 45
darwin 3 6.0 2024/05/17 16:15:00 32 2024/05/17 16:28:00 32
win64 2 4.0 2024/05/17 13:34:00 47 2024/05/17 14:42:00 39
3.3.1 19 38.0 2024/05/17 11:10:00 26 2024/05/17 14:42:00 39
3.2.2 10 20.0 2024/05/17 11:29:00 44 2024/05/17 12:24:00 45
3.2.3 21 42.0 2024/05/17 11:04:00 38 2024/05/17 16:28:00 32

Source:

{ %VERSION=1.1 }

{$ifdef fpc}
  {$mode objfpc}
{$endif}

uses SysUtils;

{$ifndef fpc}
type
  qword=int64;
  dword=cardinal;
{$endif}

var
  error: boolean;

{$r+}
function testlongint_int64(i: int64; shouldfail: boolean): boolean;
var
  l: longint;
  failed: boolean;
begin
  failed := false;
  try
    l := i;
  except
    failed := true;
  end;
  result := failed = shouldfail;
  error := error or not result;
end;

function testlongint_qword(i: qword; shouldfail: boolean): boolean;
var
  l: longint;
  failed: boolean;
begin
  failed := false;
  try
    l := i;
  except
    failed := true;
  end;
  result := failed = shouldfail;
  error := error or not result;
end;

function testdword_int64(i: int64; shouldfail: boolean): boolean;
var
  l: dword;
  failed: boolean;
begin
  failed := false;
  try
    l := i;
  except
    failed := true;
  end;
  result := failed = shouldfail;
  error := error or not result;
end;

function testdword_qword(i: qword; shouldfail: boolean): boolean;
var
  l: dword;
  failed: boolean;
begin
  failed := false;
  try
    l := i;
  except
    failed := true;
  end;
  result := failed = shouldfail;
  error := error or not result;
end;

{$r-}

var
  i: int64;
  q: qword;
begin
  error := false;
{ *********************** int64 to longint ********************* }
  writeln('int64 to longint');
  i := $ffffffffffffffff;
  writeln(i);
  if not testlongint_int64(i,false) then
    writeln('test1 failed');
  i := i and $ffffffff00000000;
  writeln(i);
  if not testlongint_int64(i,true) then
    writeln('test2 failed');
  inc(i);
  writeln(i);
  if not testlongint_int64(i,true) then
    writeln('test3 failed');
  i := $ffffffff80000000;
  writeln(i);
  if not testlongint_int64(i,false) then
    writeln('test4 failed');
  i := $80000000;
  writeln(i);
  if not testlongint_int64(i,true) then
    writeln('test5 failed');
  dec(i);
  writeln(i);
  if not testlongint_int64(i,false) then
    writeln('test6 failed');
  i := $ffffffff;
  writeln(i);
  if not testlongint_int64(i,true) then
    writeln('test7 failed');
  i := 0;
  writeln(i);
  if not testlongint_int64(i,false) then
    writeln('test8 failed');

{ *********************** qword to longint ********************* }
  writeln;
  writeln('qword to longint');
  q := qword($ffffffffffffffff);
  writeln(q);
  if not testlongint_qword(q,true) then
    writeln('test1 failed');
  q := q and $ffffffff00000000;
  writeln(q);
  if not testlongint_qword(q,true) then
    writeln('test2 failed');
  inc(q);
  writeln(q);
  if not testlongint_qword(q,true) then
    writeln('test3 failed');
  q := $ffffffff80000000;
  writeln(q);
  if not testlongint_qword(q,true) then
    writeln('test4 failed');
  q := $80000000;
  writeln(q);
  if not testlongint_qword(q,true) then
    writeln('test5 failed');
  dec(q);
  writeln(q);
  if not testlongint_qword(q,false) then
    writeln('test6 failed');
  q := $ffffffff;
  writeln(q);
  if not testlongint_qword(q,true) then
    writeln('test7 failed');
  q := 0;
  writeln(q);
  if not testlongint_qword(q,false) then
    writeln('test8 failed');

{ *********************** int64 to dword ********************* }
  writeln;
  writeln('int64 to dword');
  i := $ffffffffffffffff;
  writeln(i);
  if not testdword_int64(i,true) then
    writeln('test1 failed');
  i := i and $ffffffff00000000;
  writeln(i);
  if not testdword_int64(i,true) then
    writeln('test2 failed');
  inc(i);
  writeln(i);
  if not testdword_int64(i,true) then
    writeln('test3 failed');
  i := $ffffffff80000000;
  writeln(i);
  if not testdword_int64(i,true) then
    writeln('test4 failed');
  i := $80000000;
  writeln(i);
  if not testdword_int64(i,false) then
    writeln('test5 failed');
  dec(i);
  writeln(i);
  if not testdword_int64(i,false) then
    writeln('test6 failed');
  i := $ffffffff;
  writeln(i);
  if not testdword_int64(i,false) then
    writeln('test7 failed');
  i := 0;
  writeln(i);
  if not testdword_int64(i,false) then
    writeln('test8 failed');

{ *********************** qword to dword ********************* }
  writeln;
  writeln('qword to dword');
  q := $ffffffffffffffff;
  writeln(q);
  if not testdword_qword(q,true) then
    writeln('test1 failed');
  q := q and $ffffffff00000000;
  writeln(q);
  if not testdword_qword(q,true) then
    writeln('test2 failed');
  inc(q);
  writeln(q);
  if not testdword_qword(q,true) then
    writeln('test3 failed');
  q := $ffffffff80000000;
  writeln(q);
  if not testdword_qword(q,true) then
    writeln('test4 failed');
  q := $80000000;
  writeln(q);
  if not testdword_qword(q,false) then
    writeln('test5 failed');
  dec(q);
  writeln(q);
  if not testdword_qword(q,false) then
    writeln('test6 failed');
  q := $ffffffff;
  writeln(q);
  if not testdword_qword(q,false) then
    writeln('test7 failed');
  q := 0;
  writeln(q);
  if not testdword_qword(q,false) then
    writeln('test8 failed');

  if error then
    begin
      writeln;
      writeln('still range check problems!');
      halt(1);
    end;
end.

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