X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Ftimerpm.t;h=51d81d5b0909b627db2d068aef442b88b76bea02;hb=c894bef09bb0c2ca14154379167515cee29344f1;hp=3e3624b0fe57857e5ba7e0a74c6e464550eedfc1;hpb=7b6a53a1f5064ca5b8ab0243f7bcf6209e6bf5a4;p=sdlgit%2FSDL_perl.git diff --git a/t/timerpm.t b/t/timerpm.t index 3e3624b..51d81d5 100644 --- a/t/timerpm.t +++ b/t/timerpm.t @@ -31,15 +31,30 @@ # # basic testing of SDL::Timer +use strict; +use SDL; +use SDL::Config; +use Test::More; + BEGIN { unshift @INC, 'blib/lib','blib/arch'; } -use strict; -use SDL; -use SDL::Config; +sub check_fail_timer +{ + my $ret = 0; + eval + { + $ret = SDL::Init(SDL_INIT_TIMER); + }; + return 1 if ($@ or $ret == -1); + return 0; +} -use Test::More; +if( check_fail_timer() ) +{ + plan( skip_all => "Cannot initialize timer!!" ); +} plan ( tests => 4 ); @@ -51,7 +66,6 @@ can_ok ('SDL::Timer', qw/ my $fired = 0; -SDL::Init(SDL_INIT_TIMER); my $timer = new SDL::Timer sub { $fired++ }, -delay => 30, -times => 1;