X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fmixerpm.t;h=14a4e4da63fff5d0b44014c2d0878080f3ad3d0a;hb=1cca9d3bb9340f60a40744c5e6e3e2c999a4fb50;hp=fba9a73ce1106889f95efe5e7785b48e2c49a480;hpb=90a923382e8e9e33cb05615210265687dcae9597;p=sdlgit%2FSDL_perl.git diff --git a/t/mixerpm.t b/t/mixerpm.t index fba9a73..14a4e4d 100644 --- a/t/mixerpm.t +++ b/t/mixerpm.t @@ -2,7 +2,6 @@ # # Copyright (C) 2003 Tels # Copyright (C) 2004 David J. Goehrig -# # Copyright (C) 2005 David J. Goehrig # # ------------------------------------------------------------------------------ @@ -31,18 +30,34 @@ # # basic testing of SDL::Mixer +use strict; +use SDL; +use SDL::Config; +use Test::More; + BEGIN { unshift @INC, 'blib/lib','blib/arch'; } -use strict; -use SDL; -use SDL::Config; +sub check_fail_mixer +{ + my $ret = 0; + eval + { + $ret = SDL::Init(SDL_INIT_AUDIO); + }; + return 1 if ($@ or $ret == -1); + return 0; +} + +if( check_fail_mixer() ) +{ + plan( skip_all => "Cannot initialize Audio for Mixer!!" ); +} -use Test::More; if ( SDL::Config->has('SDL_mixer') ) { - plan ( tests => 2 ); + plan ( tests => 3 ); } else { plan ( skip_all => 'SDL_mixer support not compiled' ); @@ -89,6 +104,6 @@ can_ok ('SDL::Mixer', qw/ # 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'); +my $mixer = SDL::Mixer->new(); +isa_ok($mixer, 'SDL::Mixer', 'Checking if mixer can be build');