X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fextendingrect.t;h=3a100471238cdb3139926ac3a7461133b801d1d7;hb=b520c503f0ef852d70678b0107a48c92bf9de1ed;hp=f27ab52289f394ad05b94b3088f528deacdc23e6;hpb=43a05747be5e7eff8cdc93e23914962f263098d9;p=sdlgit%2FSDL_perl.git diff --git a/t/extendingrect.t b/t/extendingrect.t index f27ab52..3a10047 100644 --- a/t/extendingrect.t +++ b/t/extendingrect.t @@ -3,17 +3,12 @@ use base 'SDL::Rect'; sub new { my $class = shift; - my $x = shift || 0; - my $y = shift || 0; - my $w = shift || 0; - my $h = shift || 0; - my $self = $class->SUPER::new($x, $y, $w, $h); - unless ($$self) { + my $self = $class->SUPER::new(@_); + unless (ref $self) { require Carp; Carp::croak SDL::GetError(); } - bless $self, $class; - return $self; + return bless $self => $class;; } @@ -25,7 +20,7 @@ sub foo { package main; use Test::More tests => 6; -my $rect = MyRect->new; +my $rect = MyRect->new(0,0,0,0); isa_ok($rect, 'SDL::Rect'); isa_ok($rect, 'MyRect');