From: Kartik Thakore Date: Mon, 9 Nov 2009 15:09:11 +0000 (-0500) Subject: Exit the infinite event loop if no pending events X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=196422a4a1d4ae5c125faf1b1b8ed0f97275a374;p=sdlgit%2FSDL_perl.git Exit the infinite event loop if no pending events --- diff --git a/t/core_events.t b/t/core_events.t index d5d670e..909c6e9 100644 --- a/t/core_events.t +++ b/t/core_events.t @@ -132,7 +132,7 @@ while(1) { SDL::Events::pump_events(); pass '[pump_event] ran'; -SDL::Events::poll_event($event); +my $ret = SDL::Events::poll_event($event); if ($event->type == SDL_ACTIVEEVENT) { @@ -140,6 +140,7 @@ if ($event->type == SDL_ACTIVEEVENT) last; } +last if ($ret == 0 ); } is( $got_event, 1, '[poll_event] Got the right event back out') ;