From: Leon Brocard Date: Fri, 16 Oct 2009 08:14:41 +0000 (+0100) Subject: test pitch, SDL::GetClipRect X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=af85b4e965c2e73b698059ea4e4acffb9816b060;p=sdlgit%2FSDL_perl.git test pitch, SDL::GetClipRect --- diff --git a/t/core_surface.t b/t/core_surface.t index 497c5bb..7878582 100644 --- a/t/core_surface.t +++ b/t/core_surface.t @@ -15,13 +15,21 @@ use SDL::Surface; use SDL::App; use SDL::Rect; use SDL::Color; -use Test::More tests => 9; +use Test::More tests => 15; my $surface - = SDL::Surface->new( SDL::SDL_ANYFORMAT(), 640, 320, 0, 0, 0, 0, 0 ); + = SDL::Surface->new( SDL::SDL_ANYFORMAT(), 640, 320, 8, 0, 0, 0, 0 ); isa_ok( $surface, 'SDL::Surface' ); -is( $surface->w, 640, 'surface has width' ); -is( $surface->h, 320, 'surface has height' ); +is( $surface->w, 640, 'surface has width' ); +is( $surface->h, 320, 'surface has height' ); +is( $surface->pitch, 640, 'surface has pitch' ); +my $clip_rect = SDL::Rect->new( 0, 0, 0, 0 ); +SDL::GetClipRect( $surface, $clip_rect ); +isa_ok( $clip_rect, 'SDL::Rect' ); +is( $clip_rect->x, 0, 'clip_rect has x' ); +is( $clip_rect->y, 0, 'clip_rect has y' ); +is( $clip_rect->w, 640, 'clip_rect has width' ); +is( $clip_rect->h, 320, 'clip_rect has height' ); my $image = SDL::Surface->load('test/data/logo.png'); is( $image->w, 608, 'image has width' );