From: Kartik Thakore Date: Mon, 26 Oct 2009 15:27:39 +0000 (-0400) Subject: Bug in the logic of a test X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b9125226e1a2240a047fc28b69e8471626d6c147;p=sdlgit%2FSDL_perl.git Bug in the logic of a test --- diff --git a/t/core_ttf.t b/t/core_ttf.t index 2228143..cb6a9f9 100644 --- a/t/core_ttf.t +++ b/t/core_ttf.t @@ -20,8 +20,8 @@ SDL::TTF_Init(); my $ttf_font = SDL::TTF_OpenFont( 'test/data/aircut3.ttf', 12 ); isa_ok( $ttf_font, 'SDL::TTF_Font' ); my ( $w, $h ) = @{ SDL::TTF_SizeText( $ttf_font, 'Hello!' ) }; -is( $w == 27 || 28, 1, '"Hello!" has width 27' ); -is( $h == 14 || 15, 1, '"Hello!" has width 14' ); +is( ($w == 27) || ($w == 28), 1, '"Hello!" has width 27' ); +is( ($h == 14) || ($h == 15), 1, '"Hello!" has width 14' ); my $surface = SDL::TTF_RenderText_Blended( $ttf_font, 'Hello!', SDL::Color->new( 255, 0, 0 ) ); diff --git a/t/core_video.t b/t/core_video.t index 4f03b98..d7cf955 100644 --- a/t/core_video.t +++ b/t/core_video.t @@ -56,7 +56,8 @@ SDL::Video::update_rect($display, 0, 0, 0, 0); #TODO: Write to surface and check inf pixel in that area got updated. SDL::Video::update_rects($display, SDL::Rect->new(0, 10, 20, 20)); -is( (SDL::Video::flip($display) == 0 || -1), 1, '[flip] returns 0 or -1' ); +my $value = SDL::Video::flip($display); +is( ($value == 0) || ($value == -1), 1, '[flip] returns 0 or -1' ); pass "Are we still alive?";