codetools: fixed testfpcsrcunitrules when no ppu exists

git-svn-id: trunk@26836 -
This commit is contained in:
mattias 2010-07-26 10:08:00 +00:00
parent 1ce765fdda
commit 288d85bcae

View File

@ -322,6 +322,7 @@ begin
Units:=UnitSet.GetConfigCache(false).Units; Units:=UnitSet.GetConfigCache(false).Units;
// first list all duplicates with a ppu file (important) // first list all duplicates with a ppu file (important)
if Units<>nil then begin
Cnt:=0; Cnt:=0;
Node:=SrcDuplicates.Tree.FindLowest; Node:=SrcDuplicates.Tree.FindLowest;
while Node<>nil do begin while Node<>nil do begin
@ -337,6 +338,7 @@ begin
Node:=SrcDuplicates.Tree.FindSuccessor(Node); Node:=SrcDuplicates.Tree.FindSuccessor(Node);
end; end;
if Cnt>0 then writeln; if Cnt>0 then writeln;
end;
// then list all duplicates without a ppu file (unimportant) // then list all duplicates without a ppu file (unimportant)
Cnt:=0; Cnt:=0;
@ -345,8 +347,7 @@ begin
Item:=PStringToStringTreeItem(Node.Data); Item:=PStringToStringTreeItem(Node.Data);
aUnitName:=Item^.Name; aUnitName:=Item^.Name;
Files:=Item^.Value; Files:=Item^.Value;
PPUFile:=Units[aUnitName]; if (Units=nil) or (Units[aUnitName]='') then begin
if PPUFile='' then begin
if Cnt=0 then writeln; if Cnt=0 then writeln;
inc(Cnt); inc(Cnt);
writeln('HINT: duplicate source files: unit=',aUnitName,' files=',Files); writeln('HINT: duplicate source files: unit=',aUnitName,' files=',Files);