Skip to content

Commit

Permalink
skipping callback test
Browse files Browse the repository at this point in the history
  • Loading branch information
FROGGS committed Feb 13, 2012
1 parent 1a951ee commit f995789
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions t/mixer_channels.t
Expand Up @@ -37,7 +37,7 @@ use SDL::Mixer::MixChunk;


my $can_open = 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 );


unless($can_open == 0) unless($can_open == 0)
{ {
plan( skip_all => 'Cannot open audio :'.SDL::get_error() ); plan( skip_all => 'Cannot open audio :'.SDL::get_error() );
} }
Expand All @@ -56,8 +56,14 @@ my $callback = sub {
printf( "[channel_finished] callback called for channel %d\n", $channel); printf( "[channel_finished] callback called for channel %d\n", $channel);
$finished++; $finished++;
}; };
SDL::Mixer::Channels::channel_finished($callback);
pass '[channel_finished] registered callback'; SKIP:
{
skip( 'No callbacks unless SDL_RELEASE_TESTING', 1 )
unless $ENV{'SDL_RELEASE_TESTING'};
SDL::Mixer::Channels::channel_finished($callback);
pass '[channel_finished] registered callback';
}


my $delay = 500; my $delay = 500;
my $audio_test_file = 'test/data/silence.wav'; my $audio_test_file = 'test/data/silence.wav';
Expand Down Expand Up @@ -187,9 +193,14 @@ ok( $delay, 'delay definedness madness test #15' );
SDL::Mixer::close_audio(); SDL::Mixer::close_audio();
pass '[close_audio] ran'; pass '[close_audio] ran';


is( $finished > 0, SKIP:
{
skip( 'No callbacks unless SDL_RELEASE_TESTING', 1 )
unless $ENV{'SDL_RELEASE_TESTING'};
is( $finished > 0,
1, '[callback_finished] called the callback got ' . $finished 1, '[callback_finished] called the callback got ' . $finished
); );
}


if ($audiodriver) { if ($audiodriver) {
$ENV{SDL_AUDIODRIVER} = $audiodriver; $ENV{SDL_AUDIODRIVER} = $audiodriver;
Expand Down

0 comments on commit f995789

Please sign in to comment.