Skip Menu |
 

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the XML-Stream CPAN distribution.

Report information
The Basics
Id: 56574
Status: resolved
Priority: 0/
Queue: XML-Stream

People
Owner: dapatrick [...] cpan.org
Requestors: TODDR [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.23
Fixed in: 1.23_02



Subject: Test suite under perl 5.12 produces warnings
Download (untitled) / with headers
text/plain 2.6k
The test suite now looks like this. + make test PERL_DL_NONLAZY=1 /usr/local/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/0-signature.t .. skipped: Set the environment variable TEST_SIGNATURE to enable this test. Cannot resolve rpmb-centos-4-64bit: at lib/XML/Stream.pm line 409. # Looks like you planned 56 tests but ran 1. # Looks like your test exited with 255 just after 1. t/buildxml.t ..... Dubious, test returned 255 (wstat 65280, 0xff00) Failed 55/56 subtests t/cdata.t ........ ok t/load.t ......... ok Cannot resolve rpmb-centos-4-64bit: at /home/user/tmp/XML-Stream- 1.23/blib/lib/XML/Stream.pm line 409. t/parse_node.t ... Dubious, test returned 255 (wstat 65280, 0xff00) Failed 6/7 subtests Cannot resolve rpmb-centos-4-64bit: at /home/user/tmp/XML-Stream- 1.23/blib/lib/XML/Stream.pm line 409. t/parse_tree.t ... Dubious, test returned 255 (wstat 65280, 0xff00) Failed 4/5 subtests Use of uninitialized value within @_ in lc at lib/XML/Stream/Parser.pm line 71. Use of uninitialized value within @_ in lc at lib/XML/Stream/Parser.pm line 71. t/quotes.t ....... ok Cannot resolve rpmb-centos-4-64bit: at /home/user/tmp/XML-Stream- 1.23/blib/lib/XML/Stream.pm line 409. # Looks like you planned 4 tests but only ran 1. # Looks like your test died just after 1. t/tcpip.t ........ Dubious, test returned 255 (wstat 65280, 0xff00) Failed 3/4 subtests t/tcpip2ssl.t .... ok Use of uninitialized value within @_ in lc at /home/user/tmp/XML-Stream- 1.23/blib/lib/XML/Stream/Parser.pm line 71. Use of uninitialized value within @_ in lc at /home/user/tmp/XML-Stream- 1.23/blib/lib/XML/Stream/Parser.pm line 71. t/xml2config.t ... ok Use of uninitialized value within @_ in lc at /home/user/tmp/XML-Stream- 1.23/blib/lib/XML/Stream/Parser.pm line 71. Use of uninitialized value within @_ in lc at /home/user/tmp/XML-Stream- 1.23/blib/lib/XML/Stream/Parser.pm line 71. t/xpath.t ........ ok Test Summary Report ------------------- t/buildxml.t (Wstat: 65280 Tests: 1 Failed: 0) Non-zero exit status: 255 Parse errors: Bad plan. You planned 56 tests but ran 1. t/parse_node.t (Wstat: 65280 Tests: 1 Failed: 0) Non-zero exit status: 255 Parse errors: Bad plan. You planned 7 tests but ran 1. t/parse_tree.t (Wstat: 65280 Tests: 1 Failed: 0) Non-zero exit status: 255 Parse errors: Bad plan. You planned 5 tests but ran 1. t/tcpip.t (Wstat: 65280 Tests: 1 Failed: 0) Non-zero exit status: 255 Parse errors: Bad plan. You planned 4 tests but ran 1. Files=11, Tests=130, 2 wallclock secs ( 0.06 usr 0.06 sys + 0.83 cusr 0.21 csys = 1.16 CPU) Result: FAIL Failed 4/11 test programs. 0/130 subtests failed.
Download (untitled) / with headers
text/plain 219b
This patch should prevent the warning on line 71, but I'm concerned why an odd number of parameters are being passed in. Note this warning was not present prior to perl 5.12 so the issue would not have been visible.
Subject: patch.txt
Download patch.txt
text/plain 381b
diff --git a/lib/XML/Stream/Parser.pm b/lib/XML/Stream/Parser.pm index a84484b..8174959 100644 --- a/lib/XML/Stream/Parser.pm +++ b/lib/XML/Stream/Parser.pm @@ -68,7 +68,7 @@ sub new bless($self); my %args; - while($#_ >= 0) { $args{ lc pop(@_) } = pop(@_); } + while(@_ > 1) { $args{ lc pop(@_) } = pop(@_); } $self->{PARSING} = 0; $self->{DOC} = 0;
Download (untitled) / with headers
text/plain 311b
This was happening in the code because the class name was not being pulled off of @_. so I guess $ARGS{undef} used to == the class name. Was this intentional? Looking at the code, I don't think so. An additional patch might be advisable to shift the class name off of @_ and bless using the class name:
Subject: patch.txt
Download patch.txt
text/plain 469b
diff --git a/lib/XML/Stream/Parser.pm b/lib/XML/Stream/Parser.pm index a84484b..022fd80 100644 --- a/lib/XML/Stream/Parser.pm +++ b/lib/XML/Stream/Parser.pm @@ -63,12 +63,10 @@ use XML::Stream::Node; sub new { - my $self = { }; - - bless($self); + my $self = bless({}, shift); my %args; - while($#_ >= 0) { $args{ lc pop(@_) } = pop(@_); } + while(@_ > 1) { $args{ lc pop(@_) } = pop(@_); } $self->{PARSING} = 0; $self->{DOC} = 0;
Download (untitled) / with headers
text/plain 180b
Todd, Thanks for the report and patch. This is weird, because this passes most of the time, according to CPAN Testers: http://matrix.cpantesters.org/?dist=XML-Stream+1.23 Darian
I do see it failing with this error on previous versions as well. Weird.
Download (untitled) / with headers
text/plain 103b
I just perlbrewed 5.12.2 and I can reproduce the errors here, but the tests still pass. I'm fixing now.
Download (untitled) / with headers
text/plain 236b
Okay, this kind of makes more sense now. I only saw one pre-5.12 fail from CPAN Testers and that was a 5.11 build. I patched this and it's up on github now. Only the shift and corrected bless call were necessary. Thanks again, Darian


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.