Browse Source

* adjusted tests as SizeOf(TParamFlags) = 1 does not need to be true anymore

git-svn-id: trunk@35264 -
svenbarth 8 years ago
parent
commit
fd465ff500
2 changed files with 6 additions and 4 deletions
  1. 3 3
      tests/webtbs/tw12038.pp
  2. 3 1
      tests/webtbs/tw2886.pp

+ 3 - 3
tests/webtbs/tw12038.pp

@@ -209,7 +209,7 @@ var
    ProcessThisProperty : boolean;
    Fu_ResultType: String;
    Flags: TParamFlags;
-   Flag:byte;
+   Flag:word;
    Definition: String;
 begin
   // Finding property type 
@@ -275,7 +275,7 @@ begin
         for i:= 1 to DTypeData^.ParamCount do
           begin
             { First Handle the ParamFlag }
-           Flag:=byte(DTypeData^.ParamList[CurrentParamPosition]);
+           Flag:=pword(@DTypeData^.ParamList[CurrentParamPosition])^;
            Flags:=TParamFlags(Flag);
            writeln('ord(Flags):',ord(DTypeData^.ParamList[CurrentParamPosition]));
 //         For i:= 1 to NumI do
@@ -294,7 +294,7 @@ begin
              then Definition := Definition+('out ');
            
            { Next char is the length of the ParamName}
-           inc(CurrentParamPosition);
+           inc(CurrentParamPosition,SizeOf(TParamFlags));
            ParamNameLength := ord( DTypeData^.ParamList[CurrentParamPosition]);
            { Next extract the Name of the Parameter }
            ParamName := '';

+ 3 - 1
tests/webtbs/tw2886.pp

@@ -40,7 +40,9 @@ begin
 //  for i:=0 to ParamCount-1 do begin
 
     // SizeOf(TParamFlags) is 4, but the data is only 1 byte
-    Len:=1; // typinfo.pp comment is wrong: SizeOf(TParamFlags)
+    //Len:=1; // typinfo.pp comment is wrong: SizeOf(TParamFlags)
+    // Note by SB (2017-01-08): No longer true since typinfo uses packed sets
+    Len:=SizeOf(TParamFlags);
     inc(Offset,Len);
 
     // read ParamName