codetools: tests: default property

git-svn-id: trunk@50049 -
This commit is contained in:
mattias 2015-10-13 20:12:32 +00:00
parent 12645682d5
commit 397b374d95
3 changed files with 18 additions and 2 deletions

View File

@ -13,9 +13,12 @@ type
{ TMyClass1 }
TMyClass1 = class
private
function GetItems(Index: Integer): TComponent;
public
constructor Create{declaration:System.TObject.Create};
procedure DefaultHandler{declaration:System.TObject.DefaultHandler}(var message); override;
property Items[Index: Integer]: TComponent read GetItems; default;
end;
{ TMyClass2 }
@ -29,9 +32,16 @@ implementation
{ TMyClass1 }
function TMyClass1.GetItems(Index: Integer): TComponent;
begin
if Index=0 then ;
Result:=nil;
end;
constructor TMyClass1{declaration:fdt_basic.TMyClass1}.Create{declaration:fdt_basic.TMyClass1.Create};
begin
Self.Items{declaration:fdt_basic.TMyClass1.Items}[0].Name{declaration:Classes.TComponent.Name}:='';
Self[0].Name{declaration:Classes.TComponent.Name}:='';
end;
procedure TMyClass1.DefaultHandler(var message);

View File

@ -88,6 +88,8 @@ procedure TTestFindDeclaration.FindDeclarations(Filename: string);
PrependPath(Tool.GetSourceName(false),Result);
ctnProcedure:
PrependPath(Tool.ExtractProcName(Node,[]),Result);
ctnProperty:
PrependPath(Tool.ExtractPropName(Node,false),Result);
end;
Node:=Node.Parent;
end;

View File

@ -40,7 +40,7 @@
<PackageName Value="fpcunitconsolerunner"/>
</Item2>
</RequiredPackages>
<Units Count="9">
<Units Count="10">
<Unit0>
<Filename Value="finddeclarationtest.lpr"/>
<IsPartOfProject Value="True"/>
@ -77,6 +77,10 @@
<Filename Value="fdt_with.pas"/>
<IsPartOfProject Value="True"/>
</Unit8>
<Unit9>
<Filename Value="fpctests/tdefaultproperty1.pas"/>
<IsPartOfProject Value="True"/>
</Unit9>
</Units>
</ProjectOptions>
<CompilerOptions>