3 # Copyright (C) 2003 Tels
4 # Copyright (C) 2004 David J. Goehrig
6 # Copyright (C) 2005 David J. Goehrig <dgoehrig\@cpan.org>
8 # ------------------------------------------------------------------------------
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.
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.
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
24 # ------------------------------------------------------------------------------
26 # Please feel free to send questions, suggestions or improvements to:
32 # basic testing of SDL::Timer
40 unshift @INC, 'blib/lib','blib/arch';
48 $ret = SDL::Init(SDL_INIT_TIMER);
50 return 1 if ($@ or $ret == -1);
54 if( check_fail_timer() )
56 plan( skip_all => "Cannot initialize timer!!" );
61 use_ok( 'SDL::Timer' );
63 can_ok ('SDL::Timer', qw/
70 my $timer = new SDL::Timer
71 sub { $fired++ }, -delay => 30, -times => 1;
73 isa_ok($timer, 'SDL::Timer');
76 is ($fired, 1,'timer fired once');