From: Kartik Thakore Date: Thu, 22 Oct 2009 01:48:48 +0000 (-0400) Subject: Added mem leak test for core X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c37bd81727180841b3680c0d341974156a7786ff;p=sdlgit%2FSDL_perl.git Added mem leak test for core --- diff --git a/t/core_memleak.t b/t/core_memleak.t new file mode 100644 index 0000000..bb7f135 --- /dev/null +++ b/t/core_memleak.t @@ -0,0 +1,30 @@ +#!perl +use strict; +use warnings; +use Test::More; +use SDL; + + +sub overlay_leak() +{ + +SDL::Init(SDL_INIT_VIDEO); + +my $display = SDL::SetVideoMode(640,480,32, SDL_SWSURFACE ); + +my $overlay = SDL::Overlay->new( 100, 100, SDL_YV12_OVERLAY, $display); + +$overlay = undef; + +$display = undef; + +} + + +eval 'use Test::Valgrind'; +plan skip_all => 'Test::Valgrind is required to test your distribution with valgrind' if $@; + +overlay_leak(); + + + diff --git a/t/core_overlay.t b/t/core_overlay.t index 38cb83a..b80fdba 100644 --- a/t/core_overlay.t +++ b/t/core_overlay.t @@ -14,5 +14,10 @@ my $overlay = SDL::Overlay->new( 100, 100, SDL_YV12_OVERLAY, $display); isa_ok( $overlay, 'SDL::Overlay'); +$overlay = undef; + +$display = undef; + +