From: Kartik Thakore Date: Mon, 28 Sep 2009 00:32:05 +0000 (-0400) Subject: This is wierd. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=60465232b81d6eb83ef1e79f2101df2735275c87;p=sdlgit%2FSDL_perl.git This is wierd. --- diff --git a/t/sdlgamerect.t b/t/sdlgamerect.t index 5b9560d..d3725e5 100644 --- a/t/sdlgamerect.t +++ b/t/sdlgamerect.t @@ -24,22 +24,16 @@ my $app = SDL::App->new(-title => "Test", -width => 640, -height => 480, -init = my $rect = SDL::Game::Rect->new(); -sub draw -{ - my $blue = SDL::Color->new( -r => 0x00, -g => 0x00, -b => 0xff, ); - - - $_[0]->fill($_[1],$blue); - $_[0]->update($_[1]); - $_[0]->sync; + $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 @@ -54,22 +48,22 @@ is ($rect->x, 15, 'x and left point to the same place'); is ($rect->x(12), 12, 'x is now 12'); is ($rect->left, 12, 'left is an alias to x'); -draw($app, $rect); - is ($rect->top(132), 132, 'top is now 132'); 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'); -draw($app, $rect); + $app->fill($rect,$blue); + $app->update($rect); + $app->sync; + sleep(1); + is ($rect->w(54), 54, 'w is now 54'); 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'); -draw($app, $rect); - 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');