Skip to content

Commit

Permalink
Mixer test can only continue if open_audio has succesfully ran
Browse files Browse the repository at this point in the history
  • Loading branch information
kthakore committed Dec 24, 2010
1 parent c36888f commit b78c275
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 5 deletions.
8 changes: 7 additions & 1 deletion t/mixer_channels.t
Expand Up @@ -32,8 +32,14 @@ use SDL::Mixer::Samples;
use threads;
use threads::shared;

my $can_open = SDL::Mixer::open_audio( 44100, SDL::Audio::AUDIO_S16SYS, 2, 4096 );

is( SDL::Mixer::open_audio( 44100, SDL::Audio::AUDIO_S16SYS, 2, 4096 ),
unless($can_open == 0)
{
plan( skip_all => 'Cannot open audio :'.SDL::get_error() );
}

is( $can_open ,
0, '[open_audio] ran'
);

Expand Down
9 changes: 8 additions & 1 deletion t/mixer_effects.t
Expand Up @@ -32,7 +32,14 @@ use SDL::Mixer::Channels;
use SDL::Mixer::Effects;
use SDL::Mixer::Samples;

is( SDL::Mixer::open_audio( 44100, SDL::Audio::AUDIO_S16SYS, 2, 1024 ),
my $can_open = SDL::Mixer::open_audio( 44100, SDL::Audio::AUDIO_S16SYS, 2, 4096 );

unless($can_open == 0)
{
plan( skip_all => 'Cannot open audio :'.SDL::get_error() );
}

is( $can_open ,
0, '[open_audio] ran'
);

Expand Down
8 changes: 7 additions & 1 deletion t/mixer_groups.t
Expand Up @@ -30,8 +30,14 @@ use SDL::Mixer;
use SDL::Mixer::Channels;
use SDL::Mixer::Groups;
use SDL::Mixer::Samples;
my $can_open = SDL::Mixer::open_audio( 44100, SDL::Audio::AUDIO_S16SYS, 2, 4096 );

is( SDL::Mixer::open_audio( 44100, SDL::Audio::AUDIO_S16SYS, 2, 4096 ),
unless($can_open == 0)
{
plan( skip_all => 'Cannot open audio :'.SDL::get_error() );
}

is( $can_open ,
0, '[open_audio] ran'
);
is( SDL::Mixer::Channels::allocate_channels(8),
Expand Down
7 changes: 5 additions & 2 deletions t/mixer_samples.t
Expand Up @@ -51,9 +51,12 @@ my @left = qw/
quick_load_RAW
/;

SDL::Mixer::open_audio( 44100, SDL::Audio::AUDIO_S16SYS, 2, 4096 );
my $can_open = SDL::Mixer::open_audio( 44100, SDL::Audio::AUDIO_S16SYS, 2, 4096 );

my $version = SDL::Mixer::linked_version();
unless($can_open == 0)
{
plan( skip_all => 'Cannot open audio :'.SDL::get_error() );
}my $version = SDL::Mixer::linked_version();
printf(
"got version: %d.%d.%d\n",
$version->major, $version->minor, $version->patch
Expand Down

0 comments on commit b78c275

Please sign in to comment.