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,21 +322,23 @@ 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)
Cnt:=0; if Units<>nil then begin
Node:=SrcDuplicates.Tree.FindLowest; Cnt:=0;
while Node<>nil do begin Node:=SrcDuplicates.Tree.FindLowest;
Item:=PStringToStringTreeItem(Node.Data); while Node<>nil do begin
aUnitName:=Item^.Name; Item:=PStringToStringTreeItem(Node.Data);
Files:=Item^.Value; aUnitName:=Item^.Name;
PPUFile:=Units[aUnitName]; Files:=Item^.Value;
if CompareFileExt(PPUFile,'ppu',false)=0 then begin PPUFile:=Units[aUnitName];
if Cnt=0 then writeln; if CompareFileExt(PPUFile,'ppu',false)=0 then begin
inc(Cnt); if Cnt=0 then writeln;
writeln('WARNING: duplicate source file for ppu ',aUnitName,' files=',Files); inc(Cnt);
writeln('WARNING: duplicate source file for ppu ',aUnitName,' files=',Files);
end;
Node:=SrcDuplicates.Tree.FindSuccessor(Node);
end; end;
Node:=SrcDuplicates.Tree.FindSuccessor(Node); if Cnt>0 then writeln;
end; end;
if Cnt>0 then writeln;
// 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);