Fixed the pod path in archive
[sdlgit/SDL_perl.git] / t / timerpm.t
index 430c2f7..8f0a337 100644 (file)
 #
 # 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' ); 
@@ -62,5 +72,5 @@ my $timer = new SDL::Timer
 
 isa_ok($timer, 'SDL::Timer');
 
-SDL::Delay(100);
+SDL::delay(100);
 is ($fired, 1,'timer fired once');