Browse Source

Updated some test cases (especially with OK statements to see the results when they are run by themselves).

git-svn-id: branches/svenbarth/classhelpers@16795 -
svenbarth 14 years ago
parent
commit
3b4eae7d23

+ 1 - 0
tests/test/tchlp12.pp

@@ -30,5 +30,6 @@ begin
   f := TFoo.Create;
   if f.Test <> 2 then
     Halt(1);
+  Writeln('ok');
 end.
 

+ 1 - 0
tests/test/tchlp13.pp

@@ -39,5 +39,6 @@ begin
   f := TFooSub.Create;
   if f.Test <> 3 then
     Halt(1);
+  Writeln('ok');
 end.
 

+ 1 - 1
tests/test/tchlp14.pp

@@ -4,7 +4,7 @@
 program tchlp14;
 
 {$ifdef fpc}
-  {$mode objfpc}
+  {$mode delphi}
 {$endif}
 
 type

+ 1 - 0
tests/test/tchlp15.pp

@@ -30,5 +30,6 @@ begin
   f := TFoo.Create;
   if f.Test <> 2 then
     Halt(1);
+  Writeln('ok');
 end.
 

+ 2 - 2
tests/test/tchlp26.pp

@@ -1,6 +1,6 @@
-{ %FAIL }
+{ %NORUN }
 
-{ class helpers must extend the same class if inheriting }
+{ class helpers can extend a subclass of the parent's extended class }
 program tchlp26;
 
 {$ifdef fpc}

+ 1 - 0
tests/test/tchlp27.pp

@@ -17,5 +17,6 @@ begin
   Writeln('f.Test: ', res);
   if res <> 2 then
     Halt(1);
+  Writeln('ok');
 end.
 

+ 2 - 0
tests/test/tchlp28.pp

@@ -24,5 +24,7 @@ begin
   Writeln('b.Test: ', res);
   if res <> 3 then
     Halt(2);
+
+  Writeln('ok');
 end.
 

+ 2 - 0
tests/test/tchlp29.pp

@@ -24,5 +24,7 @@ begin
   Writeln('b.Test: ', res);
   if res <> 3 then
     Halt(2);
+
+  Writeln('ok');
 end.
 

+ 2 - 0
tests/test/tchlp30.pp

@@ -17,5 +17,7 @@ begin
   Writeln('f.Test: ', res);
   if res <> 2 then
     Halt(1);
+
+  Writeln('ok');
 end.
 

+ 2 - 0
tests/test/tchlp31.pp

@@ -17,5 +17,7 @@ begin
   Writeln('b.Test: ', res);
   if res <> 3 then
     Halt(1);
+
+  Writeln('ok');
 end.
 

+ 1 - 0
tests/test/tchlp33.pp

@@ -17,5 +17,6 @@ begin
   Writeln('f.Test: ', res);
   if res <> 1 then
     Halt(1);
+  Writeln('ok');
 end.
 

+ 9 - 7
tests/test/tchlp36.pp

@@ -1,5 +1,6 @@
-{ %NORUN }
+{ %FAIL }
 
+{ a class helper must extend a subclass of the parent class helper }
 program tchlp36;
 
 {$ifdef fpc}
@@ -7,7 +8,11 @@ program tchlp36;
 {$endif}
 
 type
-  TObjectHelper = class helper for TObject
+  TBar = class
+
+  end;
+
+  TBarHelper = class helper for TBar
     procedure Test;
   end;
 
@@ -15,15 +20,12 @@ type
 
   end;
 
-  TFooHelper = class helper(TObjectHelper) for TFoo
+  TFooHelper = class helper(TFooHelper) for TFoo
   end;
 
-procedure TObjectHelper.Test;
+procedure TBarHelper.Test;
 begin
 end;
 
-var
-  f: TFoo;
 begin
-  f.Test;
 end.