mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-30 23:02:47 +02:00
test: added pen test based on code from Paul
git-svn-id: trunk@16832 -
This commit is contained in:
parent
8b00789839
commit
a4e981a88f
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -3782,6 +3782,7 @@ test/bugs/testfileproc.pas svneol=native#text/plain
|
||||
test/bugs/testfileutil.pas svneol=native#text/plain
|
||||
test/bugtestcase.pas svneol=native#text/plain
|
||||
test/hello.ahk svneol=native#text/plain
|
||||
test/lcltests/testpen.pas svneol=native#text/plain
|
||||
test/lcltests/testunicode.pas svneol=native#text/plain
|
||||
test/readme.txt svneol=native#text/plain
|
||||
test/runtests.lpi svneol=native#text/plain
|
||||
|
47
test/lcltests/testpen.pas
Normal file
47
test/lcltests/testpen.pas
Normal file
@ -0,0 +1,47 @@
|
||||
unit TestPen;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, fpcunit,
|
||||
Interfaces, LCLType, LCLIntf,
|
||||
testglobals;
|
||||
|
||||
type
|
||||
|
||||
{ TTestPen }
|
||||
|
||||
TTestPen = class(TTestCase)
|
||||
published
|
||||
procedure TestOne;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
{ TTestPen }
|
||||
|
||||
procedure TTestPen.TestOne;
|
||||
var
|
||||
APen: HPEN;
|
||||
LP, Test: TLogPen;
|
||||
begin
|
||||
LP.lopnColor := $FF0000;
|
||||
LP.lopnStyle := PS_DASHDOTDOT;
|
||||
LP.lopnWidth := Point(2, 0);
|
||||
APen := CreatePenIndirect(LP);
|
||||
AssertFalse('Creating of APen failed', APen = 0);
|
||||
// APen created
|
||||
AssertEquals('Wrong return value of GetObject(APen, 0, nil)',
|
||||
SizeOf(TLogPen), GetObject(APen, 0, nil));
|
||||
GetObject(APen, SizeOf(Test), @Test);
|
||||
AssertTrue( 'Pens are not equal', CompareMem(@Test, @LP, SizeOf(TLogPen)));
|
||||
DeleteObject(APen);
|
||||
end;
|
||||
|
||||
initialization
|
||||
AddToLCLTestSuite(TTestPen);
|
||||
|
||||
end.
|
||||
|
@ -5,7 +5,7 @@ unit TestUnicode;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, fpcunit, testregistry, LCLProc, testglobals;
|
||||
Classes, SysUtils, fpcunit, LCLProc, testglobals;
|
||||
|
||||
type
|
||||
|
||||
|
@ -35,7 +35,7 @@
|
||||
<PackageName Value="LCL"/>
|
||||
</Item4>
|
||||
</RequiredPackages>
|
||||
<Units Count="5">
|
||||
<Units Count="7">
|
||||
<Unit0>
|
||||
<Filename Value="runtests.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
@ -61,6 +61,16 @@
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="TestUnicode"/>
|
||||
</Unit4>
|
||||
<Unit5>
|
||||
<Filename Value="testunits.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="testunits"/>
|
||||
</Unit5>
|
||||
<Unit6>
|
||||
<Filename Value="lcltests\testpen.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="TestPen"/>
|
||||
</Unit6>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
|
@ -35,7 +35,7 @@
|
||||
<PackageName Value="CodeTools"/>
|
||||
</Item4>
|
||||
</RequiredPackages>
|
||||
<Units Count="8">
|
||||
<Units Count="9">
|
||||
<Unit0>
|
||||
<Filename Value="runtestsgui.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
@ -76,6 +76,11 @@
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="BugTestCase"/>
|
||||
</Unit7>
|
||||
<Unit8>
|
||||
<Filename Value="lcltests\testpen.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="TestPen"/>
|
||||
</Unit8>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
|
@ -30,7 +30,7 @@ uses
|
||||
TestLpi, BugTestCase,
|
||||
bug8432, testfileutil, testfileproc,
|
||||
// lcltests
|
||||
testunicode;
|
||||
testunicode, testpen;
|
||||
|
||||
implementation
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user