diff options
author | Michael Bishop <mbtyke@gmail.com> | 2013-03-08 18:03:12 -0500 |
---|---|---|
committer | Michael Bishop <mbtyke@gmail.com> | 2013-03-08 18:03:12 -0500 |
commit | 81cdeaa3766e34acfb2f5cbaa25cf71d7d761bcc (patch) | |
tree | 36472b14ab9dd27e499c3871f1a5a152f3a6b0eb /tests | |
parent | 404380d16573f326cd04363dd926cdd303662dc6 (diff) |
Added test and fixed bugs exposed by the test.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/sdl_audio_mix.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/sdl_audio_mix.c b/tests/sdl_audio_mix.c index 6866f555..e3431e0c 100644 --- a/tests/sdl_audio_mix.c +++ b/tests/sdl_audio_mix.c @@ -17,9 +17,11 @@ void one_iter() { switch( frames ) { case 1: soundChannel = Mix_PlayChannel(-1, sound, 0); - assert(soundChannel != -1); + printf("channel = %d", soundChannel); + assert(soundChannel != -1 && soundChannel != 0); break; case 2: + printf("channel %d is playing = %d", soundChannel, Mix_Playing(soundChannel)); assert(Mix_Playing(soundChannel)); break; case 30: @@ -54,7 +56,13 @@ void one_iter() { int main(int argc, char **argv) { SDL_Init(SDL_INIT_AUDIO); - + Mix_Init(MIX_INIT_OGG); + + // This reserves channel 0 for other purposes. + // We are just going to verify that we are not + // allocated channel 0 when we call Mix_PlayChannel(-1, ...) + Mix_ReserveChannels(1); + int ret = Mix_OpenAudio(0, 0, 0, 0); // we ignore all these.. assert(ret == 0); |