Browse Source

* restored version

michael 27 years ago
parent
commit
5132685b05
7 changed files with 123 additions and 0 deletions
  1. 13 0
      tests/TS010009.PP
  2. 15 0
      tests/ts010010.pp
  3. 18 0
      tests/ts010014.bat
  4. 42 0
      tests/ts010014.pp
  5. 18 0
      tests/ts010100.bat
  6. 6 0
      tests/ts010100.pp
  7. 11 0
      tests/ts010101.pp

+ 13 - 0
tests/TS010009.PP

@@ -0,0 +1,13 @@
+unit ts010009;
+
+  interface
+
+  type
+     tr = record
+        case a : (x,y,z) of
+           x : (l : longint);
+        end;
+
+  implementation
+
+end.

+ 15 - 0
tests/ts010010.pp

@@ -0,0 +1,15 @@
+uses
+   ts010009;
+
+  var
+     r : tr;
+
+  begin
+     r.a:=x;
+     if r.a=x then
+       begin
+          with r do
+            if a=y then
+              ;
+       end;
+  end.

+ 18 - 0
tests/ts010014.bat

@@ -0,0 +1,18 @@
+@echo off
+rem
+rem Batch file to compile and run ts010014
+rem
+echo Compiling ts010014...
+ppc386 ts010014 >nul
+if errorlevel 1 goto comfailed
+echo compilation of ts010014 : PASSED
+ts010014 >nul
+if errorlevel 0 goto runpassed
+echo execution of ts010014 : FAILED
+goto end
+:runpassed
+echo execution of ts010014 : PASSED
+goto end
+:comfailed
+echo Compilation of ts010014 : FAILED
+:end

+ 42 - 0
tests/ts010014.pp

@@ -0,0 +1,42 @@
+{$R+}
+type
+   ta = object
+      constructor init;
+      destructor done;
+      procedure p;virtual;
+   end;
+
+   pa = ^ta;
+
+constructor ta.init;
+
+  begin
+  end;
+
+destructor ta.done;
+
+  begin
+  end;
+
+procedure ta.p;
+
+  begin
+  end;
+
+type
+   plongint = ^longint;
+
+var
+   p : pa;
+   data : array[0..4] of longint;
+
+begin
+   fillchar(data,sizeof(data),12);
+   p:=new(pa,init);
+   p^.p;
+   { the vmt pointer gets an invalid value: }
+   plongint(p)^:=longint(@data);
+   { causes runerror }
+   p^.p;
+   halt(1);
+end.

+ 18 - 0
tests/ts010100.bat

@@ -0,0 +1,18 @@
+@echo off
+rem
+rem Batch file to compile and run ts010100
+rem
+echo Compiling ts010100...
+ppc386 ts010100 >nul
+if errorlevel 1 goto comfailed
+echo compilation of ts010100 : PASSED
+ts010100 >nul
+if errorlevel 0 goto runpassed
+echo execution of ts010100 : FAILED
+goto end
+:runpassed
+echo execution of ts010100 : PASSED
+goto end
+:comfailed
+echo Compilation of ts010100 : FAILED
+:end

+ 6 - 0
tests/ts010100.pp

@@ -0,0 +1,6 @@
+var
+   o : tobject;
+
+begin
+   halt(1);
+end.

+ 11 - 0
tests/ts010101.pp

@@ -0,0 +1,11 @@
+{ tests assignements and compare }
+
+var
+   o1,o2 : tobject;
+
+begin
+   o1:=nil;
+   o2:=o1;
+   if o2<>nil then
+     halt(1);
+end.