t_id
54
t_version
1.1
t_adddate
2003/10/03
t_result
0
t_knownrunerror
0
tr_id | run | tr_ok | tr_skip | tr_result |
---|---|---|---|---|
950516364 | 1015756 | True | False | Successfully run |
Record count: 1
{ %VERSION=1.1 } {$mode objfpc} type ITest = interface(IUnknown) procedure DoSomething; end; TMyClass = class(TInterfacedObject, ITest) procedure DoSomething; end; var i : longint; procedure TMyClass.DoSomething; begin inc(i); end; procedure DoTest(const ATest: ITest); begin ATest.DoSomething; end; procedure DoTest2(ATest: ITest); begin ATest.DoSomething; end; var c: TMyClass; begin i:=0; c := TMyClass.Create; DoTest(c); DoTest2(c); c.Free; if i<>2 then begin writeln('Problem with passing interfaces as parameters'); halt(1); end; end.