From: Leon Brocard Date: Tue, 10 Nov 2009 14:47:57 +0000 (+0000) Subject: Implement init_sub_system and quit_sub_system X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c620f5967ced2e2ebb903a81205f1d0b78ce76aa;p=sdlgit%2FSDL_perl.git Implement init_sub_system and quit_sub_system --- diff --git a/src/SDL.xs b/src/SDL.xs index fa7a7ac..6299cdd 100644 --- a/src/SDL.xs +++ b/src/SDL.xs @@ -281,7 +281,7 @@ init ( flags ) RETVAL int -init_subsystem ( flags ) +init_sub_system ( flags ) Uint32 flags CODE: RETVAL = SDL_InitSubSystem(flags); @@ -289,7 +289,7 @@ init_subsystem ( flags ) RETVAL void -quit_subsystem ( flags ) +quit_sub_system ( flags ) Uint32 flags CODE: SDL_QuitSubSystem(flags); diff --git a/t/core.t b/t/core.t index bf30250..0edf8bc 100644 --- a/t/core.t +++ b/t/core.t @@ -4,7 +4,7 @@ use SDL; use SDL::Video; use Test::More; -plan ( tests => 11 ); +plan ( tests => 13 ); my @done =qw/ init quit @@ -14,6 +14,8 @@ my @done =qw/ linked_version putenv getenv + init_sub_system + quit_sub_system /; use_ok( 'SDL' ); @@ -27,6 +29,11 @@ my $display = SDL::Video::set_video_mode(640,480,232, SDL_SWSURFACE ); isnt( SDL::get_error(), '', '[get_error] got error '.SDL::get_error() ); +SDL::quit_sub_system(SDL_INIT_VIDEO); +isnt( SDL::was_init( SDL_INIT_VIDEO ), SDL_INIT_VIDEO, '[was_init] recognizes turned off sub system'); +SDL::init_sub_system(SDL_INIT_VIDEO); +is( SDL::was_init( SDL_INIT_VIDEO ), SDL_INIT_VIDEO, '[was_init] recognizes turned back on sub system'); + SDL::quit(); pass '[quit] SDL quit with out segfaults or errors'; isnt( SDL::was_init( 0 ), SDL_INIT_VIDEO, '[was_init] recognizes turned off flags'); @@ -35,8 +42,6 @@ is(SDL::putenv('PERLSDL_TEST=hello'), 0, '[putenv] returns 0'); is(SDL::getenv('PERLSDL_TEST'), 'hello', '[getenv] returns hello'); my @left = qw/ - init_sub_system - quit_sub_system set_error error clear_error