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

t_id 1004
t_version 1.1
t_adddate 2003/10/06
t_result 0
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/10/19 07:29:00 50 2024/10/19 13:34:00 29
i386 5 10.0 2024/10/19 08:55:00 60 2024/10/19 10:27:00 65
m68k 2 4.0 2024/10/19 07:29:00 50 2024/10/19 09:50:00 39
sparc 3 6.0 2024/10/19 08:05:00 45 2024/10/19 11:16:00 40
powerpc 5 10.0 2024/10/19 08:40:00 51 2024/10/19 13:26:00 65
arm 2 4.0 2024/10/19 09:36:00 32 2024/10/19 10:03:00 32
x86_64 10 20.0 2024/10/19 08:27:00 30 2024/10/19 13:34:00 29
powerpc64 7 14.0 2024/10/19 08:43:00 65 2024/10/19 10:45:00 52
mips 2 4.0 2024/10/19 09:54:00 35 2024/10/19 10:28:00 38
mipsel 2 4.0 2024/10/19 09:59:00 38 2024/10/19 10:35:00 142
aarch64 5 10.0 2024/10/19 08:33:00 23 2024/10/19 09:57:00 26
sparc64 3 6.0 2024/10/19 08:33:00 120 2024/10/19 10:46:00 141
riscv64 2 4.0 2024/10/19 10:25:00 33 2024/10/19 11:10:00 26
loongarch64 2 4.0 2024/10/19 09:45:00 25 2024/10/19 10:17:00 30
linux 35 70.0 2024/10/19 07:29:00 50 2024/10/19 11:16:00 40
go32v2 3 6.0 2024/10/19 08:55:00 60 2024/10/19 10:27:00 65
solaris 6 12.0 2024/10/19 13:22:00 24 2024/10/19 13:34:00 29
aix 6 12.0 2024/10/19 08:40:00 51 2024/10/19 13:26:00 65
3.3.1 30 60.0 2024/10/19 08:05:00 45 2024/10/19 13:26:00 65
3.2.3 20 40.0 2024/10/19 07:29:00 50 2024/10/19 13:34:00 29

Source:

{ %version=1.1}
{$IFDEF FPC}
{$MODE OBJFPC}
{$ENDIF}
program texception5;
uses
  SysUtils;


type
  ETestException = class(Exception)
    constructor Create;
    destructor Destroy; override;
  end;


var
  exc_destroyed: boolean;
  exc          : ETestException;

constructor ETestException.Create;
begin
  exc_destroyed := false;
  exc := Self;
end;


destructor ETestException.Destroy;
begin
  inherited;
  exc_destroyed := true;
end;

var
  exc2: Exception;

begin
  // first test, exception should not be freed
  try
    raise ETestException.Create;
  except
    exc2 := Exception(AcquireExceptionObject);
    if exc <> exc2 then halt(11);
  end;
  if exc_destroyed then halt(12);
  if exc <> exc2 then halt(13);
  exc2.Free;

  // second test, exception should be freed
  try
    raise ETestException.Create;
  except
    exc2 := Exception(AcquireExceptionObject);
    if exc <> exc2 then halt(21);
    ReleaseExceptionObject;
  end;
  if not exc_destroyed then halt(22);

  // third test, exception should not be freed
  try
    raise ETestException.Create;
  except
    AcquireExceptionObject;
    AcquireExceptionObject;
    ReleaseExceptionObject;
  end;
  if exc_destroyed then halt(31);

  // exception should be freed
  try
    raise ETestException.Create;
  except
    AcquireExceptionObject;
    AcquireExceptionObject;
    ReleaseExceptionObject;
    ReleaseExceptionObject;
  end;
  if not exc_destroyed then halt(41);

  // exception should be freed, refcount zeroed when re-raising
  try
    try
      raise ETestException.Create;
    except
      on e: exception do begin
        AcquireExceptionObject;
        raise;
      end;
    end;
  except
  end;
  if not exc_destroyed then halt(51);

  // same as before but without explicit block
  try
    try
      raise ETestException.Create;
    except
      AcquireExceptionObject;
      raise;
    end;
  except
  end;
  if not exc_destroyed then halt(61);
end.

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