X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Ftimerpm.t;h=51d81d5b0909b627db2d068aef442b88b76bea02;hb=5ae1d2eef5903cd44b5afce4359f5fa4c665c8cc;hp=430c2f7652153ea348cf44594d2ce5df5facf7bc;hpb=d69de41798431967a439f343312a829b8965e053;p=sdlgit%2FSDL_perl.git diff --git a/t/timerpm.t b/t/timerpm.t index 430c2f7..51d81d5 100644 --- a/t/timerpm.t +++ b/t/timerpm.t @@ -31,21 +31,31 @@ # # basic testing of SDL::Timer -BEGIN { - unshift @INC, 'blib/lib','blib/arch'; -} - use strict; use SDL; use SDL::Config; - use Test::More; -if (SDL::Init(SDL_INIT_TIMER) < 0 ) +BEGIN { + unshift @INC, 'blib/lib','blib/arch'; +} + +sub check_fail_timer +{ + my $ret = 0; + eval + { + $ret = SDL::Init(SDL_INIT_TIMER); + }; + return 1 if ($@ or $ret == -1); + return 0; +} + +if( check_fail_timer() ) { plan( skip_all => "Cannot initialize timer!!" ); - } + plan ( tests => 4 ); use_ok( 'SDL::Timer' );