Test suite results for test file test/tstprocv.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/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:

Record count: 50

Total = 50

OK=50 Percentage= 100.00

Result type Cat. Count Percentage First date Last Date
Success, compilation failed 50 100.0 2024/05/21 01:10:00 32 2024/05/21 01:42:00 26
i386 39 78.0 2024/05/21 01:10:00 32 2024/05/21 01:41:00 34
x86_64 10 20.0 2024/05/21 01:21:00 14 2024/05/21 01:42:00 26
aarch64 1 2.0 2024/05/21 01:29:00 35 2024/05/21 01:29:00 35
linux 50 100.0 2024/05/21 01:10:00 32 2024/05/21 01:42:00 26
3.3.1 26 52.0 2024/05/21 01:12:00 28 2024/05/21 01:40:00 43
3.2.3 24 48.0 2024/05/21 01:10:00 32 2024/05/21 01:42:00 26

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.