Test suite results for test file webtbs/tw3595.pp

Test run data :

Run ID:
Operating system: linux
Processor: powerpc
Version: 3.2.3
Fails/OK/Total: 44/7941/7985
Version: 3.2.3
Full version: 3.2.3-1374-g849fbd722c-unpushed
Comment: -O- -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 10:58:00 <> 2024/04/10
Previous run: 933758
Next run: 936281

Hide skipped tests

Hide successful tests

Test file "webtbs/tw3595.pp" information:

t_id 1526
t_adddate 2005/03/15
t_result 0
t_knownrunerror 0

Detailed test run results:

tr_idruntr_oktr_skiptr_result
443630160934961TrueFalseSuccessfully run

Record count: 1

No log of 934961.

Source:

{ Source provided for Free Pascal Bug Report 3595 }
{ Submitted by "Martin Schreiber" on  2005-01-24 }
{ e-mail:  }
program project1;

{$ifdef FPC} {$mode objfpc}{$H+} {$endif}

uses
  Classes,sysutils;

type
 ttest = class(tcomponent)
  private
   fwstr: widestring;
  published
   property wstr: widestring read fwstr write fwstr;
 end;

const
 textfilename = 'test.txt';

var
 test1,test2: ttest;
 memstream: tmemorystream;
 filestream: tfilestream;

function widestringtocharinfo(const str: widestring): string;
var
 int1: integer;
begin
 result:= '';
 for int1:= 1 to length(str) do begin
  result:= result + '#' + inttostr(ord(str[int1]));
 end;
end;

begin
 test1:= ttest.create(nil);
 test2:= ttest.create(nil);
 with test1 do begin
  setlength(fwstr,3);
  fwstr[1]:= widechar(255);
  fwstr[2]:= widechar(256);
  fwstr[3]:= widechar(257);
  fwstr:= fwstr + #0#1'abcde'#127#128#129;
 end;
 try
  filestream:= tfilestream.create(textfilename,fmopenread);
  memstream:= tmemorystream.create;
  try
   objecttexttobinary(filestream,memstream);
   writeln('objecttexttobinary OK');
   try
    memstream.position:= 0;
    memstream.readcomponent(test2);
    writeln('object reading OK');
    if test1.wstr = test2.wstr then begin
     writeln('data OK');
    end
    else begin
     writeln('data wrong. expected:');
     writeln(widestringtocharinfo(test1.wstr));
     writeln('actual:');
     writeln(widestringtocharinfo(test2.wstr));
    end;
   except
    on e: exception do begin
     writeln('object reading fails: '+ e.message);
    end;
   end;
  except
   on e: exception do begin
    writeln('objecttexttobinary fails: '+e.message);
   end;
  end;
  filestream.free;
  memstream.free;
 except
  writeln('file '+textfilename+' not found.');
 end;
 filestream:= tfilestream.create(textfilename,fmcreate);
 memstream:= tmemorystream.create;
 memstream.writecomponent(test1);
 memstream.position:= 0;
 objectbinarytotext(memstream,filestream);
 memstream.free;
 filestream.free;
 test1.free;
 test2.free;
end.

Link to SVN view of webtbs/tw3595.pp source.