FreeBSD audio on cpan still fails. So fixed test to catch it better
[sdlgit/SDL_perl.git] / t / mixerpm.t
index 359d537..f7e7150 100644 (file)
@@ -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');