From: Kartik Thakore Date: Mon, 31 Aug 2009 10:19:43 +0000 (-0400) Subject: FreeBSD audio on cpan still fails. So fixed test to catch it better X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8898221d8f4f62490daab29e054fe38d824bf6d1;p=sdlgit%2FSDL_perl.git FreeBSD audio on cpan still fails. So fixed test to catch it better --- diff --git a/lib/SDL/Surface.pm b/lib/SDL/Surface.pm index 8d09500..d0a53d6 100644 --- a/lib/SDL/Surface.pm +++ b/lib/SDL/Surface.pm @@ -163,10 +163,6 @@ sub pixel { } sub fill { - croak "SDL::Surface::fill requires a SDL::Rect object" - unless !$SDL::DEBUG || $_[1] == 0 || $_[1]->isa('SDL::Rect'); - croak "SDL::Surface::fill requires a SDL::Color object" - unless !$SDL::DEBUG || $_[2]->isa('SDL::Color'); if ($_[1] == 0 ) { SDL::FillRect(${$_[0]},0,${$_[2]}); } else { diff --git a/src/SDL.xs b/src/SDL.xs index 806e609..07b3d0b 100644 --- a/src/SDL.xs +++ b/src/SDL.xs @@ -1414,10 +1414,11 @@ void UpdateRects ( surface, ... ) SDL_Surface *surface CODE: - SDL_Rect *rects, *temp; + SDL_Rect *rects, *oldrects, *temp; int num_rects,i; if ( items < 2 ) return; - num_rects = items - 1; + num_rects = items - 1; + oldrects = rects; rects = (SDL_Rect *)safemalloc(sizeof(SDL_Rect)*items); for(i=0;ihas('SDL_mixer') ) { plan ( tests => 3 ); -} else { +} +elsif ( SDL::Init(SDL_INIT_AUDIO) < 0) { + plan( skip_all => "Cannot initialize audio!!" ); + } +else { plan ( skip_all => 'SDL_mixer support not compiled' ); } @@ -87,10 +91,6 @@ can_ok ('SDL::Mixer', qw/ /); -if ( SDL::Init(SDL_INIT_AUDIO) < 0) { - plan( skip_all => "Cannot initialize audio!!" ); - } - # these are exported by default, so main:: should know them: my $mixer = SDL::Mixer->new(); isa_ok($mixer, 'SDL::Mixer', 'Checking if mixer can be build'); diff --git a/t/surfaceML.t b/t/surfaceML.t index 5b304f1..7ece8a3 100644 --- a/t/surfaceML.t +++ b/t/surfaceML.t @@ -46,11 +46,11 @@ use Test::More; sub surface_leak() { use SDL; - use SDL::Surface; + use SDL::App; use SDL::Rect; use SDL::Color; - my $window = SDL::Surface->new( + my $window = SDL::App->new( -width => 640, -height => 480, -depth => 16,