Tests: test for PageControl, workaround QT and GTK do extra paint

git-svn-id: trunk@42694 -
This commit is contained in:
martin 2013-09-09 08:36:48 +00:00
parent 426e526f9b
commit e9ab40821e

View File

@ -296,7 +296,7 @@ procedure TTestPageControl.CheckPaint(AName: String; APaintedPage: TTestSheet);
var var
i: Integer; i: Integer;
begin begin
{$IfDef LCLQT} {$IfDef LCLGTK2}
if APaintedPage <> nil then begin if APaintedPage <> nil then begin
AssertTrue(AName + ' Paint was called', APaintedPage.DidPaint >= 1); AssertTrue(AName + ' Paint was called', APaintedPage.DidPaint >= 1);
end; end;
@ -304,7 +304,7 @@ begin
if APaintedPage <> nil then begin if APaintedPage <> nil then begin
AssertEquals(AName + ' Paint was called', 1, APaintedPage.DidPaint); AssertEquals(AName + ' Paint was called', 1, APaintedPage.DidPaint);
end; end;
{$IfNDef LCLGTK2} {$IfNDef LCLQT}
for i := 0 to PageControl.ControlCount - 1 do for i := 0 to PageControl.ControlCount - 1 do
if (PageControl.Controls[i] <> APaintedPage) and (PageControl.Controls[i] is TTestSheet) then if (PageControl.Controls[i] <> APaintedPage) and (PageControl.Controls[i] is TTestSheet) then
AssertEquals(AName + 'NO paint for other page', 0, (PageControl.Controls[i] as TTestSheet).DidPaint); AssertEquals(AName + 'NO paint for other page', 0, (PageControl.Controls[i] as TTestSheet).DidPaint);