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/05/20 16:27:00 32 2024/05/20 23:33:00 0
i386 19 38.0 2024/05/20 16:41:00 44 2024/05/20 23:33:00 0
m68k 1 2.0 2024/05/20 22:44:00 190 2024/05/20 22:44:00 190
sparc 6 12.0 2024/05/20 23:25:00 38 2024/05/20 23:32:00 40
powerpc 1 2.0 2024/05/20 23:05:00 185 2024/05/20 23:05:00 185
arm 1 2.0 2024/05/20 22:30:00 59 2024/05/20 22:30:00 59
x86_64 6 12.0 2024/05/20 16:52:00 25 2024/05/20 19:35:00 26
powerpc64 2 4.0 2024/05/20 23:13:00 213 2024/05/20 23:20:00 71
mips 1 2.0 2024/05/20 22:51:00 240 2024/05/20 22:51:00 240
mipsel 1 2.0 2024/05/20 22:58:00 148 2024/05/20 22:58:00 148
aarch64 12 24.0 2024/05/20 16:27:00 32 2024/05/20 22:24:00 44
linux 11 22.0 2024/05/20 22:24:00 44 2024/05/20 23:30:00 79
solaris 22 44.0 2024/05/20 16:41:00 44 2024/05/20 23:33:00 0
darwin 11 22.0 2024/05/20 16:27:00 32 2024/05/20 17:50:00 56
win64 6 12.0 2024/05/20 16:52:00 25 2024/05/20 19:35:00 26
3.3.1 14 28.0 2024/05/20 17:01:00 26 2024/05/20 23:33:00 0
3.2.2 9 18.0 2024/05/20 16:41:00 44 2024/05/20 17:30:00 45
3.2.3 27 54.0 2024/05/20 16:27:00 32 2024/05/20 23:30:00 38

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.