Permalink
Browse files

FreeBSD audio on cpan still fails. So fixed test to catch it better

  • Loading branch information...
1 parent d69de41 commit 8898221d8f4f62490daab29e054fe38d824bf6d1 @kthakore kthakore committed Aug 31, 2009
Showing with 11 additions and 13 deletions.
  1. +0 −4 lib/SDL/Surface.pm
  2. +4 −2 src/SDL.xs
  3. +5 −5 t/mixerpm.t
  4. +2 −2 t/surfaceML.t
View
@@ -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 {
View
@@ -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;i<num_rects;i++) {
temp = (SDL_Rect *)SvIV(ST(i+1));
@@ -1428,6 +1429,7 @@ UpdateRects ( surface, ... )
}
SDL_UpdateRects(surface,num_rects,rects);
safefree(rects);
+ safefree(oldrects);
int
Flip ( surface )
View
@@ -43,7 +43,11 @@ use Test::More;
if ( SDL::Config->has('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');
View
@@ -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,

0 comments on commit 8898221

Please sign in to comment.