+++ /dev/null
-#!/usr/bin/perl -w
-use strict;
-use SDL;
-use Test::More;
-use Test::Trap;
-use Data::Dumper;
-
-plan ( tests => 4 );
-my @done =qw/ none /;
-
-SKIP:
-{
-skip 'Not implemented', 2;
-use_ok( 'SDL::Time' );
-can_ok ('SDL::Time', @done);
-}
-
-my @timerInit = trap { SDL::init(SDL_INIT_TIMER) };
-
-#diag $trap->leaveby;
-#diag Dumper $trap->return;
-#diag @timerInit[0];
-
-my @left = qw/
- add_timer
- delay
- get_ticks
- remove_timer
-/;
-
-my $why = '[Percentage Completion] '.int( 100 * $#done / ($#done + $#left) ) ."\% implementation. $#done / ".($#done+$#left);
-
-TODO:
-{
- local $TODO = $why;
- pass "\nThe following functions:\n".join ",", @left;
-}
- if( $done[0] eq 'none'){ diag '0% done 0/'.$#left } else { diag $why}
-
-
-pass 'Are we still alive? Checking for segfaults';
--- /dev/null
+#!/usr/bin/perl -w
+use strict;
+use SDL;
+use Test::More tests => 6;
+
+my @done = qw/get_ticks
+ delay/;
+
+is( SDL::init(SDL_INIT_TIMER), 0, '[init] can init SDL_INIT_TIMER' );
+is( SDL::was_init(0), SDL_INIT_TIMER, '[was_init] managed to init timer' );
+
+my $before = SDL::get_ticks();
+like( $before, qr/^\d+$/, '[get_ticks] returns a number' );
+
+# at the moment this segfaults. i wonder why?
+# my $fired = 0;
+# SDL::set_timer( 100, sub { warn "hi"; $fired = 1 } );
+
+SDL::delay(250);
+my $after = SDL::get_ticks();
+like( $after, qr/^\d+$/, '[get_ticks] returns a number again' );
+
+my $diff = $after - $before;
+ok( $diff > 50 && $diff < 300, '[delay](250) delayed for around 250ms' );
+
+# is( $fired, 1, '[set_timer] triggered' );
+
+my @left = qw/set_timer new_timer_callback add_timer remove_timer/;
+
+my $why
+ = '[Percentage Completion] '
+ . int( 100 * ( $#done + 1 ) / ( $#done + $#left + 2 ) )
+ . "\% implementation. "
+ . ( $#done + 1 ) . " / "
+ . ( $#done + $#left + 2 );
+
+TODO:
+{
+ local $TODO = $why;
+ pass "\nThe following functions:\n" . join ",", @left;
+}
+diag $why;