t_id
33
t_adddate
2003/10/03
t_result
217
t_knownrunerror
0
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 23:33:00 38 | 2024/05/21 01:27:00 0 | |
i386 | 27 | 54.0 | 2024/05/20 23:54:00 24 | 2024/05/21 01:27:00 0 | |
sparc | 9 | 18.0 | 2024/05/20 23:33:00 38 | 2024/05/20 23:55:00 41 | |
x86_64 | 9 | 18.0 | 2024/05/20 23:44:00 14 | 2024/05/21 01:25:00 26 | |
powerpc64 | 2 | 4.0 | 2024/05/21 01:10:00 101 | 2024/05/21 01:11:00 108 | |
aarch64 | 2 | 4.0 | 2024/05/21 00:12:00 32 | 2024/05/21 00:58:00 35 | |
sparc64 | 1 | 2.0 | 2024/05/20 23:47:00 148 | 2024/05/20 23:47:00 148 | |
linux | 41 | 82.0 | 2024/05/20 23:44:00 14 | 2024/05/21 01:27:00 0 | |
solaris | 9 | 18.0 | 2024/05/20 23:33:00 38 | 2024/05/20 23:55:00 41 | |
3.3.1 | 27 | 54.0 | 2024/05/20 23:37:00 42 | 2024/05/21 01:26:00 0 | |
3.2.3 | 23 | 46.0 | 2024/05/20 23:33:00 38 | 2024/05/21 01:27:00 0 |
{ %RESULT=217 } program testexceptions; {$mode objfpc} Type TAObject = class(TObject) a : longint; end; TBObject = Class(TObject) b : longint; end; Procedure raiseanexception; Var A : TAObject; begin Writeln ('Creating exception object'); A:=TAObject.Create; Writeln ('Raising with this object'); raise A; Writeln ('This can''t happen'); end; Var MaxLevel : longint; Procedure DoTryFinally (Level : Longint; DoRaise : Boolean); Var Raised,Reraised : Boolean; I : Longint; begin Try writeln ('Try(',level,') : Checking for exception'); If Level=MaxLevel then begin if DoRaise then begin Writeln ('Try(',level,'): Level ',maxlevel,' reached, raising exception.'); Raiseanexception end else Writeln ('Try(',Level,'): Not raising exception') end else begin Writeln ('Try(',level,') : jumping to next level'); DoTryFinally(Level+1,DoRaise); end; finally Writeln ('Finally (',level,'): Starting code.'); end; writeln ('Out of try/finally at level (',level,')'); end; Procedure DoTryExcept (Level : Longint; DoRaise : Boolean); Var Raised : Boolean; I : Longint; Caught : TObject; begin Try writeln ('Try(',level,') : Checking for exception'); If Level=MaxLevel then if DoRaise then begin Writeln ('Try(',level,'): Level ',maxlevel,', raising exception.'); Raiseanexception end else Writeln ('Try(',Level,'): level ',maxlevel,'. Not raising exception') else begin Writeln ('Try(',level,') : jumping to next level'); DoTryExcept(Level+1,DoRaise); end; except On TAObject do Writeln ('Exception was caught by TAObject'); On TBobject do Writeln ('Exception was caught by TBObject'); On E : TObject do Writeln ('Caught object ',E.ClassName); // writeln ('Except (',level,') : Exception caught by default handler'); end; writeln ('Out of try/except at level (',level,')'); end; Procedure DoMix (Level : Longint; DoRaise : Boolean); Var Raised : Boolean; I : Longint; Caught : TObject; begin Try Try writeln ('Try(',level,') : Checking for exception'); If Level=MaxLevel then if DoRaise then begin Writeln ('Try(',level,'): Level ',maxlevel,', raising exception.'); Raiseanexception end else Writeln ('Try(',Level,'): level ',maxlevel,'. Not raising exception') else begin Writeln ('Try(',level,') : jumping to next level'); DoMix(Level+1,DoRaise); end; finally Writeln ('Mix:Finally (',level,'): Starting code.'); end; Writeln ('Level (',level,') : Out of try/finally'); except On TAObject do Writeln ('Exception was caught by TAObject'); On TBobject do Writeln ('Exception was caught by TBObject'); On TObject do writeln ('Except (',level,') : Exception caught by TObject'); // The following don't work... On E : TObject do Writeln ('Caught object ',E.ClassName); else writeln ('Except (',level,') : Exception caught by default handler'); end; writeln ('Out of try/except at level (',level,')'); end; function _dotryfinally : boolean; var problem : boolean; begin result:=false; try try finally writeln('Raising an exception in finally statement'); Raiseanexception end; except end; try exit; finally result:=true; end; writeln('Problem with finally and exit !!!!'); halt(1); end; procedure dotryfinally; begin if not(_dotryfinally) then begin writeln('Problem with finally and exit !!!!'); halt(1); end; end; Procedure Start(Const Msg : string); begin Writeln (Msg); Writeln; end; Procedure Finish; begin Writeln; Writeln ('Finished.'); writeln; { Press enter to continue.'); Readln; tests/test/test... must be non interactive !! PM } end; begin Maxlevel:=3; Start ('Testing Try/Finally without raise'); DoTryFinally (1,False); Finish; Start ('Testing Try/except without raise'); DoTryExcept (1,FAlse); Finish; Start ('Testing Mix without raise'); DoMix (1,False); Finish; Start ('Testing Try/except with raise'); DoTryExcept (1,true); Finish; Start ('Testing Mix with raise'); DoMix (1,true); Finish; Start ('Testing Try/Finally with Exit'); dotryfinally; Finish; Writeln ('Testing Try/Finally with raise'); Start ('This one should end with an error message !!.'); DoTryFinally (1,True); end.