mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 20:49:49 +02:00
Add testing of use of variable of class
git-svn-id: trunk@41417 -
This commit is contained in:
parent
af36913469
commit
1a564de6e6
@ -5,6 +5,7 @@ uses
|
||||
|
||||
type
|
||||
tc1 = class
|
||||
var a : longint;
|
||||
procedure p(var msg : TMessage);
|
||||
end;
|
||||
|
||||
@ -14,7 +15,7 @@ procedure tc1.p(var msg : TMessage);
|
||||
begin
|
||||
if (msg.msg<>1) or (msg.wparam<>2) or (msg.lparam<>3) then
|
||||
halt(1);
|
||||
msg.result:=4;
|
||||
msg.result:=4+a;
|
||||
end;
|
||||
|
||||
var
|
||||
@ -22,10 +23,15 @@ var
|
||||
c : tc1;
|
||||
begin
|
||||
c:=tc1.create;
|
||||
c.a:=0;
|
||||
|
||||
f:=tf(MakeObjectInstance(@c.p));
|
||||
|
||||
if f(0,1,2,3)<>4 then
|
||||
halt(1);
|
||||
c.a:=3;
|
||||
if f(0,1,2,3)<>7 then
|
||||
halt(2);
|
||||
|
||||
c.free;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user