X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fsdlgamerect.t;h=fb77bcde423404b57469c429c3814c58cc7f5abb;hb=af85b4e965c2e73b698059ea4e4acffb9816b060;hp=d3725e55907a4c4ab59fffc41777e0c00d165c40;hpb=60465232b81d6eb83ef1e79f2101df2735275c87;p=sdlgit%2FSDL_perl.git diff --git a/t/sdlgamerect.t b/t/sdlgamerect.t index d3725e5..fb77bcd 100644 --- a/t/sdlgamerect.t +++ b/t/sdlgamerect.t @@ -1,8 +1,6 @@ use Test::More tests => 87; use strict; use SDL; -use SDL::App; -use SDL::Color; use_ok( 'SDL::Game::Rect' ); @@ -20,20 +18,9 @@ can_ok ('SDL::Game::Rect', qw/ centery /); -my $app = SDL::App->new(-title => "Test", -width => 640, -height => 480, -init => SDL_INIT_VIDEO); -my $rect = SDL::Game::Rect->new(); +my $rect = SDL::Game::Rect->new( 0, 0, 0, 0); - - my $blue = SDL::Color->new( - -r => 0x00, - -g => 0x00, - -b => 0xff, - ); - $app->fill($rect,$blue); - $app->update($rect); - $app->sync; - sleep(1); isa_ok ($rect, 'SDL::Game::Rect','new went ok'); foreach my $attr (qw(x y top left width height @@ -53,10 +40,6 @@ is ($rect->y, 132, 'y and top point to the same place'); is ($rect->y(123), 123, 'y is now 123'); is ($rect->top, 123, 'top is an alias to y'); - $app->fill($rect,$blue); - $app->update($rect); - $app->sync; - sleep(1); is ($rect->w(54), 54, 'w is now 54'); @@ -64,6 +47,7 @@ is ($rect->width, 54, 'w and width point to the same place'); is ($rect->width(45), 45, 'w is now 45'); is ($rect->w, 45, 'w is an alias to width'); + is ($rect->h(76), 76, 'h is now 76'); is ($rect->height, 76, 'h and height point to the same place'); is ($rect->height(67), 67, 'h is now 67');