Browse Source

* tests clarified

pierre 22 years ago
parent
commit
6055372c98
2 changed files with 11 additions and 1 deletions
  1. 2 0
      tests/test/cg/tclasize.pp
  2. 9 1
      tests/test/cg/tclatype.pp

+ 2 - 0
tests/test/cg/tclasize.pp

@@ -180,6 +180,8 @@ begin
    has_error:=true;
  reset_booleans;
 
+ Writeln('Szeof(cc)=',sizeof(cc));
+
  if has_error then
    begin
      Writeln('Error with class methods');

+ 9 - 1
tests/test/cg/tclatype.pp

@@ -82,7 +82,7 @@ end;
 class procedure tbaseclass.call_virtual_class_method;
 begin
   virtual_class_method;
-  if getsize<>sizeof(self) then
+  if get_type<>typeof(self) then
     begin
       Writeln('Compiler creates garbage');
       has_error:=true;
@@ -111,11 +111,18 @@ var
   c1,cb : tbaseclass;
   cd : tderivedclass;
   cc : class of tbaseclass;
+  pb,pd : pointer;
 
 begin
  cb:=tbaseclass.create;
  cd:=tderivedclass.create;
  c1:=tbaseclass.create;
+ pb:=typeof(tbaseclass);
+ pd:=typeof(tderivedclass);
+ if pb<>typeof(cb) then
+   has_error:=true;
+ if pd<>typeof(cd) then
+   has_error:=true;
 
  basesize:=sizeof(cb);
  Writeln('Sizeof(cb)=',basesize);
@@ -195,6 +202,7 @@ begin
 
  cc:=tderivedclass;
 
+
  cc.class_check_type;
 
  cc.virtual_class_method;