Test suite results for test file test/texception5.pp

Test run data :

Run ID:
Operating system: linux
Processor: mipsel
Version: 3.3.1
Fails/OK/Total: 187/9027/9214
Version: 3.3.1
Full version: 3.3.1-15596-gcde5b1a8c5-unpushed
Comment: -ao-xgot -fPIC -XR/home/muller/sys-root/mipsel-linux -Xd -Xr/home/muller/sys-root/mipsel-linux
Machine: cfarm13
Category: 1
SVN revisions: cde5b1a8c5:484dab553b:3f8bbd3b00:902c93f3c3
Submitter: muller
Date: 2024/04/22 11:22:00
Previous run: 936381
Next run: 937661

Hide skipped tests

Hide successful 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:

tr_idruntr_oktr_skiptr_result
456304673937002TrueFalseSuccessfully run

Record count: 1

No log of 937002.

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.