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

t_id 64
t_adddate 2003/10/03
t_result 210
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 12:48:00 22
i386 11 22.0 2024/05/17 11:23:00 52 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 27 54.0 2024/05/17 11:10:00 26 2024/05/17 12:48:00 22
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
mipsel 1 2.0 2024/05/17 11:26:00 47 2024/05/17 11:26:00 47
aarch64 4 8.0 2024/05/17 11:04:00 38 2024/05/17 12:15:00 38
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 39 78.0 2024/05/17 11:04:00 38 2024/05/17 12:48:00 22
solaris 11 22.0 2024/05/17 11:23:00 52 2024/05/17 12:24:00 45
3.3.1 18 36.0 2024/05/17 11:10:00 26 2024/05/17 12:48:00 22
3.2.2 11 22.0 2024/05/17 11:23:00 52 2024/05/17 12:24:00 45
3.2.3 21 42.0 2024/05/17 11:04:00 38 2024/05/17 12:36:00 36

Source:

{ %RESULT=210 }
{$R+}

program test_fail;

  type
     parrayobj = ^tarrayobj;
     tarrayobj = object
       ar : array [1..4] of real;
       constructor init(do_fail : boolean);
       procedure test;virtual;
       destructor done;virtual;
       end;
     pbigarrayobj = ^tbigarrayobj;
     tbigarrayobj = object(tarrayobj)
       ar2 : array [1..10000] of real;
       constructor good_init;
       constructor wrong_init;
       procedure test;virtual;
       end;
  var
    pa1, pa2 : parrayobj;
    ta1, ta2 : tarrayobj;
    availmem : longint;

  constructor tarrayobj.init(do_fail : boolean);
    begin
       ar[1]:=1;
       if do_fail then
         fail;
       ar[2]:=2;
    end;

  destructor tarrayobj.done;
    begin
    end;

  procedure  tarrayobj.test;
    begin
      Writeln('@self = ',longint(@self));
      Writeln('typeof = ',longint(typeof(self)));
      if ar[1]=1 then
        Writeln('Init called');
      if ar[2]=2 then
        Writeln('Init successful');
    end;

  constructor tbigarrayobj.good_init;
    begin
      inherited init(false);
      Writeln('End of tbigarrayobj.good_init');
    end;

  constructor tbigarrayobj.wrong_init;
    begin
      inherited init(true);
      Writeln('End of tbigarrayobj.wrong_init');
    end;

  procedure tbigarrayobj.test;
    begin
      Writeln('tbigarrayobj.test called');
      Inherited test;
    end;

  begin
     availmem:=memavail;
     new(pa1,init(false));
     writeln('After successful new(pa1,init), memory used = ',availmem - memavail);
     new(pa2,init(true));
     writeln('After unsuccessful new(pa2,init), memory used = ',availmem - memavail);
     writeln('pa1 = ',longint(pa1),' pa2 = ',longint(pa2));
     writeln('Call to pa1^.test after successful init');
     pa1^.test;
     dispose(pa1,done);
     writeln('After release of pa1, memory used = ',availmem - memavail);
     pa1:=new(pbigarrayobj,good_init);
     writeln('After successful pa1:=new(pbigarrayobj,good_init), memory used = ',availmem - memavail);
     pa2:=new(pbigarrayobj,wrong_init);
     writeln('After unsuccessful pa2:=new(pbigarrayobj,wrong_init), memory used = ',availmem - memavail);
     writeln('pa1 = ',longint(pa1),' pa2 = ',longint(pa2));
     writeln('Call to pa1^.test after successful init');
     pa1^.test;
     ta1.init(false);
     writeln('Call to ta1.test after successful init');
     ta1.test;
     ta2.init(true);
     writeln('typeof(ta2) = ',longint(typeof(ta2)),' after unsuccessful init');
     Writeln('Trying to call ta2.test (should generate a Run Time Error)');
     ta2.test;
  end.

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