Add testing of use of variable of class

git-svn-id: trunk@41417 -
This commit is contained in:
pierre 2019-02-23 15:37:39 +00:00
parent af36913469
commit 1a564de6e6

View File

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