From: Kartik Thakore Date: Mon, 2 Nov 2009 23:36:00 +0000 (-0500) Subject: Update implementation status of SDL.pm and test t/core.t X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9216879c3da2c9bc363094e3d51ca2a0da3a95c0;p=sdlgit%2FSDL_perl.git Update implementation status of SDL.pm and test t/core.t --- diff --git a/t/core.t b/t/core.t index 3b677b5..7b1e060 100644 --- a/t/core.t +++ b/t/core.t @@ -1,25 +1,36 @@ #!/usr/bin/perl -w use strict; use SDL; +use SDL::Video; use Test::More; -plan ( tests => 4 ); -my @done =qw/ none /; +plan ( tests => 9 ); +my @done =qw/ + init + quit + was_init + get_error + /; -SKIP: -{ - skip 'Not implemented', 2; use_ok( 'SDL' ); can_ok ('SDL', @done); -} + +is( SDL::init(SDL_INIT_VIDEO), 0, '[init] returns 0 on success'); + +is( SDL::was_init( 0 ), SDL_INIT_VIDEO, '[was_init] recognizes turned on flags'); + +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(); pass '[quit] SDL quit with out segfaults or errors'; + +isnt( SDL::was_init( 0 ), SDL_INIT_VIDEO, '[was_init] recognizes turned off flags'); + my @left = qw/ - init init_sub_system quit_sub_system - quit - was_init - get_error set_error error clear_error @@ -28,9 +39,9 @@ my @left = qw/ unload_fuction unload_object envvars - VERSION linked_version version + Version /; my $why = '[Percentage Completion] '.int( 100 * $#done / ($#done + $#left) ) ."\% implementation. $#done / ".($#done+$#left);