File: timerpm.t

package info (click to toggle)
sdlperl 1.20.3dfsg-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,796 kB
  • ctags: 2,171
  • sloc: perl: 7,394; ansic: 232; makefile: 75; sh: 1
file content (32 lines) | stat: -rw-r--r-- 527 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/perl -w

# basic testing of SDL::Timer

use Test::More tests => 4;
use strict;
use vars qw/@INC/;

BEGIN
  {
  unshift @INC, ('../blib/lib');
  unshift @INC, ('../blib/arch');
  chdir 't' if -d 't';
  use_ok( 'SDL::Timer' ); 
  }
  
can_ok ('SDL::Timer', qw/
	new run stop
	/);

my $fired = 0;

use SDL::Event;

SDL::Init(SDL_INIT_TIMER);

my $timer = SDL::Timer->new( sub { $fired++ }, -delay => 30, -times => 1);

is (ref($timer), 'SDL::Timer', 'new went ok');

SDL::Delay(100);
is ($fired, 1,'timer fired once');