Skip Menu |

This queue is for tickets about the GD-SVG CPAN distribution.

Report information
The Basics
Id: 15910
Status: resolved
Priority: 0/
Queue: GD-SVG

People
Owner: harris [...] cshl.edu
Requestors: jdw [...] ou.edu
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: 0.27
Fixed in: (no value)



Subject: GD-SVG-0.27 does not pass tests 17 and 28
Using Solaris 9 with Perl 5.8.5 gcc 64BITALL with GD-2.30. Test 17 is "ok($image->filledArc(10, 20, 20, 40, 100, 360, $black),'filledArc (open) ok');". This test expects a true value, but a filledArc with these parameters tries to draw a pie shape by recursively calling itself twice as: $self->filledArc(10, 20, 20, 40, 100, 280, $black); # first semicircle $self->filledArc(10, 20, 20, 40, 280, 360, $black); # the rest Each of these calls returns a value which is not used. The composite does not return a value, resulting in undefined which is false. The POD does not indicate that a return value is returned. Either the test is wrong or the code should return a value and the POD should be updated. I don't know what value should be returned in this case. Test 28 is: "$polygon->offset(10, 10) > 0,'polygon offset ok');". The polygon is offset by the requested amount, but the number of points affected is not returned as the GD::SVG POD indicates. However $polygon is a GD::SVG::Polygon, which inherits the offset method from from GD::Polygon (part of GD). The offset method in GD::Polygon does not return a value and the GD::Polygon POD does not indicate that it should. It would be trivial to add "return $size;" to the end of the offset method inside GD::Polygon, but that is not there at present.
From: jdw [...] ou.edu
[guest - Thu Nov 17 18:26:37 2005]: Show quoted text
> Using Solaris 9 with Perl 5.8.5 gcc 64BITALL with GD-2.30. > > Test 17 is "ok($image->filledArc(10, 20, 20, 40, 100, 360, > $black),'filledArc (open) ok');". > This test expects a true value, but a filledArc with these parameters > tries to draw a pie shape by recursively calling itself twice as: > $self->filledArc(10, 20, 20, 40, 100, 280, $black); # first > semicircle > $self->filledArc(10, 20, 20, 40, 280, 360, $black); # the rest > Each of these calls returns a value which is not used. The composite > does not return a value, resulting in undefined which is false.
Correction -- In this case filledArc does do a "return $result;", but $result is undefined; however, the first case examined in the code: "if ($color_index eq 'gdStyled' || $color_index eq 'gdBrushed')" does not return any value. In either case the value returned as a function reference is undefined. Show quoted text
> The POD does not indicate that a return value is returned. Either > the test > is wrong or the code should return a value and the POD should be > updated. > I don't know what value should be returned in this case. > > Test 28 is: "$polygon->offset(10, 10) > 0,'polygon offset ok');". > The polygon is offset by the requested amount, but the number of > points > affected is not returned as the GD::SVG POD indicates. However > $polygon > is a GD::SVG::Polygon, which inherits the offset method from from > GD::Polygon (part of GD). The offset method in GD::Polygon does not > return a value and the GD::Polygon POD does not indicate that it > should. > It would be trivial to add "return $size;" to the end of the offset > method inside GD::Polygon, but that is not there at present.
On Thu Nov 17 18:26:37 2005, guest wrote: To 'guest': thanks for this excellent report. Saved me time investigating :) Show quoted text
> Using Solaris 9 with Perl 5.8.5 gcc 64BITALL with GD-2.30.
To Todd Harris: Just to confirm that I see the same failures. This is perl, v5.8.6 built for i586-linux-thread-multi Linux cpepc210-3 2.6.11.4-21.7-smp #1 SMP Thu Jun 2 14:23:14 UTC 2005 i686 i686 i386 GNU/Linux SUSE 9.3 Cheers, Dave
From: perlbug [...] ubc.pkts.ca
Hi.. I've got the same error; this is on Fedora Core 5, freshly installed this week. The web page says it's been 3 months since the first report. :-)
From: perlbug [...] ubc.pkts.ca
On Fri May 05 17:03:04 2006, guest wrote: Show quoted text
> Hi.. I've got the same error; this is on Fedora Core 5, freshly > installed this week. The web page says it's been 3 months since the > first report. :-) >
Er, I mean *last* report. And it's perl 5.8.8.