Test suite results for test file test/cg/treadwrt.pp

Test run data :

Run ID:
Operating system: linux
Processor: loongarch64
Version: 3.3.1
Fails/OK/Total: 38/9170/9208
Version: 3.3.1
Full version: 3.3.1-15584-g2f9ed0576e
Comment: -XR/home/muller/sys-root/loongarch64-linux -Xd -Xr/home/muller/sys-root/loongarch64-linux
Machine: cfarm421
Category: 1
SVN revisions: 2f9ed0576e:8b7dbb81b1:3f8bbd3b00:2f9ed0576e
Submitter: muller
Date: 2024/04/19 11:12:00 <> 2024/04/18
Previous run: 934325
Next run: 935672

Hide skipped tests

Hide successful tests

Test file "test/cg/treadwrt.pp" information:

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

Detailed test run results:

tr_idruntr_oktr_skiptr_result
443688233934973TrueFalseSuccessfully run

Record count: 1

No log of 934973.

Source:

{$i+}

{ Widestring is not supported in 1.0.x }
{$ifndef VER1_0}
  {$define HASWIDESTR}
{$endif VER1_0}

function getint64_1 : int64;
var
 value : longint;
begin
 value:=1;
 getint64_1 := int64(value) shl 40; 
end;

function getint64_2 : int64;
var
 value : longint;
begin
 value:=65535;
 getint64_2 := value; 
end;

procedure test_rwtext;
var
  t: text;
  s: shortstring;
  a: ansistring;
{$ifdef HASWIDESTR}
  wc : widechar;
  w : widestring;
{$endif HASWIDESTR}
  l: longint;
  card: cardinal;
  b: byte; bool: boolean;
  c: char;
  arr: array[1..10] of char;
  p: pchar;
  r: real;
  vl : int64;
  vl1 : int64;
  tmplong : longint;
begin
  bool := true;
  writeln('ShortString const test');
  writeln('ShortString const test with const len':70);
  b := 60;
  writeln('ShortString const test with var len':b);
  s := 'ShortStr var test';
  writeln(s);
  s := s+ ' with const len';
  writeln(s:40);
  s := 'ShortStr var test with var len';
  writeln(s:b);

  l := -1; c := 'y'; card := 18; r := 5.1234;
  writeln('A combo test: ',b,' ',l,' ',c,' ',card,' ',bool:10);
  writeln('floats: ',r,' ',r:1,' ',r:8,' ',r:10:2);
  arr := 'arrofchars';
  writeln('array of char: ',arr:38);

  arr[10] := #0;
  p := @arr;
  writeln('pchar test: ',p);

  a := 'this is an ansistring';
  writeln(a);
  
  vl:=getint64_1;
  vl1:=getint64_2;
  writeln('int64 test : ',vl, ' ',vl1);

{$ifdef HASWIDESTR}
  wc := 'y';
  writeln('widechar: ',wc);
  w := 'this is a widestring';
  writeln(w);
{$endif HASWIDESTR}

  write('no new line now...',l,c,b);

  write;
  read;

  assign(t,'treadwrt.txt');
  rewrite(t);
  writeln('testing text file functionality...');
  writeln(t,'this is a string');
  writeln(t,l);
  writeln(t,c);
  writeln(t,b);
  writeln(t,vl);
  writeln(t,vl1);
  l := 0;
  c := #32;
  b := 5;
  vl:=1;
  vl1 := 2;
  close(t);
  reset(t);
  readln(t,s);
  if s <> 'this is a string' then
    halt(1);
  readln(t,l);
  if l <> -1 then
    halt(1);
  readln(t,c);
  if c <> 'y' then
    halt(1);
  readln(t,b);
  if b <> 60 then
    halt(1);
  { 64-bit read testing }
  readln(t,vl);
  if vl <> getint64_1 then
    halt(1);
  readln(t,vl1);
  if vl1 <> getint64_2 then
    halt(1);
  close(t);
  erase(t);
  writeln('write/read text passed...');
end;

procedure test_rwtyped;
var
  f: file of cardinal;
  c: cardinal;
begin
  assign(f,'treadwrt.dat');
  rewrite(f);
  c := 8;
  write(f,c);
  write(f,cardinal(10));
  close(f);
  reset(f);
  read(f,c);
  if c <> 8 then
    halt(1);
  read(f,c);
  if c <> 10 then
    halt(1);
  close(f);
  erase(f);
  writeln('write/read typed passed...');
end;

begin
  test_rwtext;
  test_rwtyped;
end.

Link to SVN view of test/cg/treadwrt.pp source.