Branch Coverage

blib/lib/SDLx/Rect.pm
Criterion Covered Total %
branch 32 170 18.8


line true false branch
18 0 18 unless ($$self)
52 1 4 if (defined $val)
60 1 4 if (defined $val)
68 1 7 if (defined $val)
76 82 11 if (defined $val)
85 0 81 unless defined $w or defined $h
88 81 0 if (defined $w)
91 81 0 if (defined $h)
99 2 3 unless defined $y or defined $x
102 2 1 if (defined $x)
105 2 1 if (defined $y)
115 2 3 unless defined $centery or defined $x
120 2 1 if (defined $x)
123 2 1 if (defined $centery)
132 0 0 unless defined $bottom or defined $x
135 0 0 if (defined $x)
138 0 0 if (defined $bottom)
148 2 3 unless defined $centerx or defined $centery
152 2 1 if (defined $centerx)
155 2 1 if (defined $centery)
164 0 0 unless defined $y or defined $right
167 0 0 if (defined $right)
170 0 0 if (defined $y)
180 0 0 unless defined $centery or defined $right
185 0 0 if (defined $right)
188 0 0 if (defined $centery)
198 0 0 unless defined $bottom or defined $right
203 0 0 if (defined $right)
206 0 0 if (defined $bottom)
215 0 0 unless defined $centerx or defined $y
218 0 0 if (defined $y)
221 0 0 if (defined $centerx)
231 0 0 unless defined $centerx or defined $bottom
236 0 0 if (defined $bottom)
239 0 0 if (defined $centerx)
266 0 1 unless (defined $x and defined $y)
281 0 0 unless (defined $x and defined $y)
294 0 1 unless (defined $x and defined $y)
310 0 0 unless (defined $x and defined $y)
326 0 0 if ($self_len >= $rect_len) { }
0 0 elsif ($self_pos < $rect_pos) { }
0 0 elsif ($self_pos + $self_len > $rect_pos + $rect_len) { }
340 0 0 unless ($rect->isa('SDL::Rect'))
353 0 0 unless ($rect->isa('SDL::Rect'))
373 0 0 if ($self->x >= $rect->x and $self->x < $rect->x + $rect->w) { }
0 0 elsif ($rect->x >= $self->x and $rect->x < $self->x + $self->w) { }
386 0 0 if ($self->x + $self->w > $rect->x and $self->x + $self->w <= $rect->x + $rect->w) { }
0 0 elsif ($rect->x + $rect->w > $self->x and $rect->x + $rect->w <= $self->x + $self->w) { }
399 0 0 if ($self->y >= $rect->y and $self->y < $rect->y + $rect->h) { }
0 0 elsif ($rect->y >= $self->y and $rect->y < $self->y + $self->h) { }
412 0 0 if ($self->y + $self->h > $rect->y and $self->y + $self->h <= $rect->y + $rect->h) { }
0 0 elsif ($rect->y + $rect->h > $self->y and $rect->y + $rect->h <= $self->y + $self->h) { }
435 0 0 unless ($rect->isa('SDL::Rect'))
447 0 0 unless ($rect->isa('SDL::Rect'))
465 0 0 $self->x < $rect->x ? :
466 0 0 $self->y < $rect->y ? :
468 0 0 $self->x + $self->w > $rect->x + $rect->w ? :
473 0 0 $self->y + $self->h > $rect->y + $rect->h ? :
484 0 0 unless ($rect->isa('SDL::Rect'))
495 0 0 unless ($rect->isa('SDL::Rect'))
519 0 0 unless ($rect->isa('SDL::Rect'))
526 0 0 if $rect->x < $left
527 0 0 if $rect->y < $top
528 0 0 if $rect->x + $rect->w > $right
530 0 0 if $rect->y + $rect->h > $bottom
540 0 0 unless (defined $rects and ref $rects eq 'ARRAY')
552 0 0 unless (defined $rects and ref $rects eq 'ARRAY')
571 0 0 $x_ratio > $y_ratio ? :
585 0 0 unless ($rect->isa('SDL::Rect'))
597 0 0 unless ($rect->isa('SDL::Rect'))
614 0 0 if ($self->w < 0)
619 0 0 if ($self->h < 0)
629 0 0 unless ($rect->isa('SDL::Rect'))
647 0 0 unless (defined $x and defined $y)
674 0 0 unless ($rect->isa('SDL::Rect'))
684 0 0 unless (defined $rects and ref $rects eq 'ARRAY')
689 0 0 if (_do_rects_intersect($self, $rects->[$i]))
699 0 0 unless (defined $rects and ref $rects eq 'ARRAY')
705 0 0 if (_do_rects_intersect($self, $rects->[$i]))
715 0 0 unless (defined $rects and ref $rects eq 'HASH')
720 0 0 unless ($value->isa('SDL::Rect'))
724 0 0 if (_do_rects_intersect($self, $value))
734 0 0 unless (defined $rects and ref $rects eq 'HASH')
740 0 0 unless ($value->isa('SDL::Rect'))
744 0 0 if (_do_rects_intersect($self, $value))