tests: more tests for classes

git-svn-id: trunk@14611 -
This commit is contained in:
paul 2010-01-11 10:07:14 +00:00
parent fd6e2cc86e
commit 67ce65eb35
3 changed files with 42 additions and 1 deletions

1
.gitattributes vendored
View File

@ -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

View File

@ -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
View 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.