{$mode objfpc} unit gsetrefcounttest; interface uses fpcunit, testregistry, gset, gutil; type arr = class a:longint; end; lll=class class function c(a,b: arr):boolean; end; type setlli=specialize RBSet; type TGSetRefCountTest = class(TTestCase) Published procedure SetTest; public procedure Setup;override; private data:setlli; end; implementation class function lll.c(a,b: arr):boolean; begin c:=a.anil do begin writeln(it^.data.a); it:=data.next(it); end; end; procedure TGSetRefCountTest.Setup; begin data:=setlli.create; end; initialization RegisterTest(TGSetRefCountTest); end.