mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-08 19:48:29 +02:00
tests: more tests for classes
git-svn-id: trunk@14611 -
This commit is contained in:
parent
fd6e2cc86e
commit
67ce65eb35
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -9233,6 +9233,7 @@ tests/test/tstatic1.pp svneol=native#text/pascal
|
||||
tests/test/tstatic2.pp svneol=native#text/pascal
|
||||
tests/test/tstatic3.pp svneol=native#text/pascal
|
||||
tests/test/tstatic4.pp svneol=native#text/pascal
|
||||
tests/test/tstatic5.pp svneol=native#text/pascal
|
||||
tests/test/tstprocv.pp svneol=native#text/plain
|
||||
tests/test/tstring1.pp svneol=native#text/plain
|
||||
tests/test/tstring10.pp svneol=native#text/plain
|
||||
|
@ -11,8 +11,11 @@ type
|
||||
PrivateConst = 1;
|
||||
type
|
||||
PrivateType = type Integer;
|
||||
var
|
||||
FPrivateField: PrivateType;
|
||||
public
|
||||
procedure DoSomething(Value: PrivateType = PrivateConst);
|
||||
property SomeProp: PrivateType read FPrivateField write FPrivateField default PrivateConst;
|
||||
end;
|
||||
|
||||
procedure TSomeClass.DoSomething(Value: PrivateType = PrivateConst);
|
||||
@ -20,4 +23,4 @@ type
|
||||
end;
|
||||
|
||||
begin
|
||||
end.
|
||||
end.
|
37
tests/test/tstatic5.pp
Normal file
37
tests/test/tstatic5.pp
Normal file
@ -0,0 +1,37 @@
|
||||
program tstatic5;
|
||||
{$APPTYPE console}
|
||||
{$ifdef fpc}
|
||||
{$mode delphi}{$H+}
|
||||
{$endif}
|
||||
|
||||
type
|
||||
|
||||
{ TSomeClass }
|
||||
|
||||
TSomeClass = class
|
||||
public
|
||||
class var
|
||||
FSomethingStatic: Integer;
|
||||
FSomethingStatic1: String;
|
||||
class procedure SetSomethingStatic(AValue: Integer); static;
|
||||
var
|
||||
FSomeRegularField: Integer;
|
||||
FSomeRegularField1: String;
|
||||
class var
|
||||
FSomethingStatic2: byte;
|
||||
class property SomethingStatic: Integer read FSomethingStatic write SetSomethingStatic;
|
||||
class property SomethingStatic1: String read FSomethingStatic1 write FSomethingStatic1;
|
||||
class property SomethingStatic2: byte read FSomethingStatic2 write FSomethingStatic2;
|
||||
property SomethingRegular: Integer read FSomeRegularField write FSomeRegularField;
|
||||
property SomethingRegular1: String read FSomeRegularField1 write FSomeRegularField1;
|
||||
end;
|
||||
|
||||
{ TSomeClass }
|
||||
|
||||
class procedure TSomeClass.SetSomethingStatic(AValue: Integer);
|
||||
begin
|
||||
FSomethingStatic := AValue;
|
||||
end;
|
||||
|
||||
begin
|
||||
end.
|
Loading…
Reference in New Issue
Block a user