Browse Source

* extend TParamFlag by pfConstRef which is set for constref parameters
* extend test trtti9.pp accordingly

git-svn-id: trunk@35175 -

svenbarth 8 years ago
parent
commit
2acf542737
2 changed files with 6 additions and 3 deletions
  1. 1 1
      rtl/objpas/typinfo.pp
  2. 5 2
      tests/test/trtti9.pp

+ 1 - 1
rtl/objpas/typinfo.pp

@@ -55,7 +55,7 @@ unit typinfo;
        TMethodKind = (mkProcedure,mkFunction,mkConstructor,mkDestructor,
                       mkClassProcedure,mkClassFunction,mkClassConstructor,
                       mkClassDestructor,mkOperatorOverload);
-       TParamFlag     = (pfVar,pfConst,pfArray,pfAddress,pfReference,pfOut);
+       TParamFlag     = (pfVar,pfConst,pfArray,pfAddress,pfReference,pfOut,pfConstRef);
        TParamFlags    = set of TParamFlag;
        TIntfFlag      = (ifHasGuid,ifDispInterface,ifDispatch,ifHasStrGUID);
        TIntfFlags     = set of TIntfFlag;

+ 5 - 2
tests/test/trtti9.pp

@@ -7,7 +7,7 @@ uses
 
 type
   PProcedureParam = ^TProcedureParam;
-  TProc = procedure(var A: Integer; S: String); stdcall;
+  TProc = procedure(var A: Integer; S: String; constref U: UnicodeString); stdcall;
 
 function TestParam(Param: PProcedureParam; Flags: TParamFlags; ParamType: Pointer; Name: ShortString): Boolean;
 begin
@@ -27,7 +27,7 @@ begin
     halt(2);
   if Data^.ProcSig.ResultType <> nil then
      halt(3);
-  if Data^.ProcSig.ParamCount <> 2 then
+  if Data^.ProcSig.ParamCount <> 3 then
      halt(4);
   Param := Data^.ProcSig.GetParam(0);
   if not TestParam(Param, [pfVar], TypeInfo(Integer), 'A') then
@@ -35,4 +35,7 @@ begin
   Param := Data^.ProcSig.GetParam(1);
   if not TestParam(Param, [], TypeInfo(String), 'S') then
      halt(6);
+  Param := Data^.ProcSig.GetParam(2);
+  if not TestParam(Param, [pfConstRef], TypeInfo(UnicodeString), 'U') then
+     halt(7);
 end.