FreeBSD audio on cpan still fails. So fixed test to catch it better
[sdlgit/SDL_perl.git] / t / mixerpm.t
1 #!/usr/bin/perl -w
2 #
3 # Copyright (C) 2003 Tels
4 # Copyright (C) 2004 David J. Goehrig
5 #
6 # Copyright (C) 2005 David J. Goehrig <dgoehrig\@cpan.org>
7 #
8 # ------------------------------------------------------------------------------
9 #
10 # This library is free software; you can redistribute it and/or
11 # modify it under the terms of the GNU Lesser General Public
12 # License as published by the Free Software Foundation; either
13 # version 2.1 of the License, or (at your option) any later version.
14
15 # This library is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18 # Lesser General Public License for more details.
19
20 # You should have received a copy of the GNU Lesser General Public
21 # License along with this library; if not, write to the Free Software
22 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
23 #
24 # ------------------------------------------------------------------------------
25 #
26 # Please feel free to send questions, suggestions or improvements to:
27 #
28 #       David J. Goehrig
29 #       dgoehrig\@cpan.org
30 #
31 #
32 # basic testing of SDL::Mixer
33
34 BEGIN {
35         unshift @INC, 'blib/lib','blib/arch';
36 }
37
38 use strict;
39 use SDL;
40 use SDL::Config;
41
42 use Test::More;
43
44 if ( SDL::Config->has('SDL_mixer') ) {
45         plan ( tests => 3 );
46
47 elsif ( SDL::Init(SDL_INIT_AUDIO) < 0) {
48                         plan( skip_all => "Cannot initialize audio!!" );
49                                 }                       
50 else {
51         plan ( skip_all => 'SDL_mixer support not compiled' );
52 }
53
54 use_ok( 'SDL::Mixer' ); 
55   
56 can_ok ('SDL::Mixer', qw/
57         new
58         query_spec
59         reserve_channels
60         allocate_channels
61         group_channel
62         group_channels
63         group_available
64         group_count
65         group_oldest
66         group_newer
67         play_channel
68         play_music
69         fade_in_channel
70         fade_in_music
71         channel_volume
72         music_volume
73         halt_channel
74         halt_group
75         halt_music
76         channel_expire
77         fade_out_channel
78         fade_out_group
79         fade_out_music
80         fading_music
81         fading_channel
82         pause
83         resume
84         paused
85         pause_music
86         resume_music
87         rewind_music
88         music_paused
89         playing
90         playing_music
91         /);
92
93
94 # these are exported by default, so main:: should know them:
95 my $mixer = SDL::Mixer->new();
96 isa_ok($mixer, 'SDL::Mixer', 'Checking if mixer can be build');
97