Test suite results for test file test/tstprocv.pp

Test run data :

Run ID:
Operating system: linux
Processor: i386
Version: 3.3.1
Fails/OK/Total: 240/9415/9655
Version: 3.3.1
Full version: 3.3.1-15584-g2f9ed0576e
Comment: -XR/home/muller/sys-root/i386-linux -Xd -Xr/home/muller/sys-root/i386-linux
Machine: cfarm421
Category: 1
SVN revisions: 2f9ed0576e:8b7dbb81b1:3f8bbd3b00:2f9ed0576e
Submitter: muller
Date: 2024/04/19 11:07:00 <> 2024/04/18
Previous run: 934323
Next run: 935660

Hide skipped tests

Hide successful tests

Test file "test/tstprocv.pp" information:

t_id 1021
t_adddate 2003/10/14
t_result 0
Flag t_fail set
t_knownrunerror 0

Detailed test run results:

tr_idruntr_oktr_skiptr_result
443671897934969TrueFalseSuccess, compilation failed

Record count: 1

No log of 934969.

Source:

{ %FAIL }
{ this compilation should fail
  because an ansitring should not be allowed
  as equivalent to a normal short string
  for procvars PM }

{$mode fpc}
{$H-}

uses
  strings;

Type
  type_error_proc = procedure (Const St : String);

Const
   error_proc : type_error_proc = nil;
   has_errors : boolean = false;
var
  st :  string;
  ast : ansistring;
  pst : pchar;



procedure string_error_proc(const err : string);
begin
{$ifdef DEBUG}
  writeln('String error proc: ',err);
{$endif DEBUG}
  if err<>st then
    has_errors:=true;
end;

procedure ansistring_error_proc(const err : ansistring);
begin
{$ifdef DEBUG}
  writeln('Ansistring error proc: ',err);
{$endif DEBUG}
  if err<>ast then
    has_errors:=true;
end;

procedure pchar_error_proc(const err : pchar);
begin
{$ifdef DEBUG}
  writeln('Pchar error proc: ',err);
{$endif DEBUG}
  if strcomp(err,pst)<>0 then
    has_errors:=true;
end;

begin
  st:='direct short string';
  string_error_proc(st);
  ast:='direct ansistring';
  ansistring_error_proc(ast);
  pst:='direct short string';
  pchar_error_proc(pst);

  error_proc:=@string_error_proc;
  st:='short string via procvar';
  error_proc(st);

  error_proc:=@ansistring_error_proc;
  ast:='ansistring via procvar';
  error_proc(ast);

  error_proc:=@pchar_error_proc;
  pst:='pchar via procvar';
  error_proc(pst);
  if has_errors then
    begin
      Writeln('Wrong code is generated');
      halt(1);
    end;
end.

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