use strict; use warnings; use Test::More; use Test::Exception; use Test::LeakTrace; use KiokuX::Model; my $model; eval { $model = KiokuX::Model->new(dsn => 'couchdb::uri=http://127.0.0.1:5984/lb-local'); }; plan skip_all => 'Cannot connect to CouchDB' if ($@); { no_leaks_ok { { my $scope = $model->new_scope; } } 'new_scope must not leak'; } done_testing; #### ot ok 1 - new_scope must not leak (leaks 2 <= 0) # Failed test 'new_scope must not leak (leaks 2 <= 0)' # at KiokuX_Model.t line 17. # '2' # <= # '0' # leaked SCALAR(0x4159810) from /usr/lib64/perl5/vendor_perl/5.12.4/KiokuDB/LiveObjects.pm line 191. # 190: # 191: $known->remove($scope); # 192: # SV = IV(0x4159808) at 0x4159810 # REFCNT = 1 # FLAGS = (IOK,pIOK) # IV = 0 # leaked ARRAY(0x4201180) from /usr/lib64/perl5/vendor_perl/5.12.4/KiokuDB/LiveObjects.pm line 260. # 259: # 260: $self->_known_scopes->insert($child); # 261: # SV = PVAV(0x4578968) at 0x4201180 # REFCNT = 2 # FLAGS = () # ARRAY = 0x4580b40 # FILL = 0 # MAX = 3 # ARYLEN = 0x0 # FLAGS = (REAL) # Elt No. 0 # SV = IV(0x4159808) at 0x4159810 # REFCNT = 1 # FLAGS = (IOK,pIOK) # IV = 0 1..1 # Looks like you failed 1 test of 1.