mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-22 14:09:59 +02:00
no message
This commit is contained in:
parent
fe2e3e0c01
commit
251a877f7d
38
tests/test/testac.pp
Normal file
38
tests/test/testac.pp
Normal file
@ -0,0 +1,38 @@
|
||||
type
|
||||
to1 = class
|
||||
constructor create;
|
||||
procedure afterconstruction;override;
|
||||
end;
|
||||
|
||||
var
|
||||
i : longint;
|
||||
|
||||
constructor to1.create;
|
||||
|
||||
begin
|
||||
inherited create;
|
||||
if i<>1000 then
|
||||
halt(1);
|
||||
i:=2000;
|
||||
end;
|
||||
|
||||
procedure to1.afterconstruction;
|
||||
|
||||
begin
|
||||
if i<>2000 then
|
||||
halt(1);
|
||||
i:=3000;
|
||||
end;
|
||||
|
||||
var
|
||||
o1 : to1;
|
||||
|
||||
begin
|
||||
i:=1000;
|
||||
o1:=to1.create;
|
||||
if i<>3000 then
|
||||
halt(1);
|
||||
o1.destroy;
|
||||
writeln('ok');
|
||||
end.
|
||||
|
38
tests/test/testbd.pp
Normal file
38
tests/test/testbd.pp
Normal file
@ -0,0 +1,38 @@
|
||||
type
|
||||
to1 = class
|
||||
destructor destroy;override;
|
||||
procedure beforedestruction;override;
|
||||
end;
|
||||
|
||||
var
|
||||
i : longint;
|
||||
|
||||
destructor to1.destroy;
|
||||
|
||||
begin
|
||||
if i<>2000 then
|
||||
halt(1);
|
||||
i:=3000;
|
||||
inherited destroy;
|
||||
end;
|
||||
|
||||
procedure to1.beforedestruction;
|
||||
|
||||
begin
|
||||
if i<>1000 then
|
||||
halt(1);
|
||||
i:=2000;
|
||||
end;
|
||||
|
||||
var
|
||||
o1 : to1;
|
||||
|
||||
begin
|
||||
o1:=to1.create;
|
||||
i:=1000;
|
||||
o1.destroy;
|
||||
if i<>3000 then
|
||||
halt(1);
|
||||
writeln('ok');
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user