Browse Source

no message

florian 25 years ago
parent
commit
251a877f7d
2 changed files with 76 additions and 0 deletions
  1. 38 0
      tests/test/testac.pp
  2. 38 0
      tests/test/testbd.pp

+ 38 - 0
tests/test/testac.pp

@@ -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 - 0
tests/test/testbd.pp

@@ -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.
+