|
@@ -102,6 +102,8 @@ type
|
|
Procedure TestFunctionArrayOfConstArg;
|
|
Procedure TestFunctionArrayOfConstArg;
|
|
procedure TestProcedureConstArrayOfConstArg;
|
|
procedure TestProcedureConstArrayOfConstArg;
|
|
Procedure TestFunctionConstArrayOfConstArg;
|
|
Procedure TestFunctionConstArrayOfConstArg;
|
|
|
|
+ procedure TestProcedureOnePointerArg;
|
|
|
|
+
|
|
Procedure TestProcedureCdecl;
|
|
Procedure TestProcedureCdecl;
|
|
Procedure TestFunctionCdecl;
|
|
Procedure TestFunctionCdecl;
|
|
Procedure TestProcedureCdeclDeprecated;
|
|
Procedure TestProcedureCdeclDeprecated;
|
|
@@ -354,6 +356,7 @@ procedure TTestProcedureFunction.AssertArg(ProcType: TPasProcedureType;
|
|
|
|
|
|
Var
|
|
Var
|
|
A : TPasArgument;
|
|
A : TPasArgument;
|
|
|
|
+ T : TPasType;
|
|
N : String;
|
|
N : String;
|
|
|
|
|
|
begin
|
|
begin
|
|
@@ -361,11 +364,21 @@ begin
|
|
N:='Argument '+IntToStr(AIndex+1)+' : ';
|
|
N:='Argument '+IntToStr(AIndex+1)+' : ';
|
|
if (TypeName='') then
|
|
if (TypeName='') then
|
|
AssertNull(N+' No argument type',A.ArgType)
|
|
AssertNull(N+' No argument type',A.ArgType)
|
|
- else
|
|
|
|
|
|
+ else if TypeName[1]<>'^' then
|
|
begin
|
|
begin
|
|
AssertNotNull(N+' Have argument type',A.ArgType);
|
|
AssertNotNull(N+' Have argument type',A.ArgType);
|
|
AssertEquals(N+' Correct argument type name',TypeName,A.ArgType.Name);
|
|
AssertEquals(N+' Correct argument type name',TypeName,A.ArgType.Name);
|
|
|
|
+ end
|
|
|
|
+ else
|
|
|
|
+ begin
|
|
|
|
+ AssertNotNull(N+' Have argument type',A.ArgType);
|
|
|
|
+ T:=A.ArgType;
|
|
|
|
+ AssertEquals(N+' type Is pointer type',TPasPointerType,T.CLassType);
|
|
|
|
+ T:=TPasPointerType(T).DestType;
|
|
|
|
+ AssertNotNull(N+'Have dest type',T);
|
|
|
|
+ AssertEquals(N+' Correct argument dest type name',Copy(TypeName,2,MaxInt),T.Name);
|
|
end;
|
|
end;
|
|
|
|
+
|
|
end;
|
|
end;
|
|
|
|
|
|
procedure TTestProcedureFunction.AssertArrayArg(ProcType: TPasProcedureType;
|
|
procedure TTestProcedureFunction.AssertArrayArg(ProcType: TPasProcedureType;
|
|
@@ -481,6 +494,13 @@ begin
|
|
AssertArg(ProcType,0,'B',argDefault,'Integer','');
|
|
AssertArg(ProcType,0,'B',argDefault,'Integer','');
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+procedure TTestProcedureFunction.TestProcedureOnePointerArg;
|
|
|
|
+begin
|
|
|
|
+ ParseProcedure('(B : ^Integer)');
|
|
|
|
+ AssertProc([],[],ccDefault,1);
|
|
|
|
+ AssertArg(ProcType,0,'B',argDefault,'^Integer','');
|
|
|
|
+end;
|
|
|
|
+
|
|
procedure TTestProcedureFunction.TestFunctionOneArg;
|
|
procedure TTestProcedureFunction.TestFunctionOneArg;
|
|
begin
|
|
begin
|
|
ParseFunction('(B : Integer)');
|
|
ParseFunction('(B : Integer)');
|