Skip Menu |

This queue is for tickets about the BZ-Client CPAN distribution.

Report information
The Basics
Id: 94402
Status: resolved
Priority: 0/
Queue: BZ-Client

People
Owner: Nobody in particular
Requestors: ppisar [...] redhat.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.04
Fixed in: (no value)

Attachments
0001-Expect-perturbed-structure-members-on-t-11writer.t.patch



Subject: t/11writer.t fails randomly with perl-5.18
t/11writer.t fails randomly with perl-5.18.2 due to randomized order of hash keys: Expect: <methodCall><methodName>someMethod</methodName><params><param><value>123 </value></param><param><value><i4>345</i4></value></param><param><value><double> 4.6</double></value></param><param><value><array><data><value>a</value><value>b< /value><value>c</value></data></array></value></param><param><value><dateTime.is Show quoted text
o8601>2011-09-19T17:09:03Z</dateTime.iso8601></value></param><param><value><stru
Show quoted text
ct><member><name>a</name><value><i4>0</i4></value></member><member><name>b</name
Show quoted text
><value>xyz</value></member></struct></value></param></params></methodCall>
Got: <methodCall><methodName>someMethod</methodName><params><param><value>123 </value></param><param><value><i4>345</i4></value></param><param><value><double> 4.6</double></value></param><param><value><array><data><value>a</value><value>b< /value><value>c</value></data></array></value></param><param><value><dateTime.is Show quoted text
o8601>2011-09-19T17:09:03Z</dateTime.iso8601></value></param><param><value><stru
Show quoted text
ct><member><name>b</name><value>xyz</value></member><member><name>a</name><value
Show quoted text
><i4>0</i4></value></member></struct></value></param></params></methodCall>
# Test 1 got: "0" (t/11writer.t at line 103) # Expected: "1" (TestBasic) # t/11writer.t line 103 is: ok(TestBasic(), 1, "TestBasic"); t/11writer.t .... Failed 1/2 subtests This subtree content has random ordering of member elements: <struct> <member> <name>b</name> <value>xyz</value> </member> <member> <name>a</name> <value><i4>0</i4></value> </member> </struct> -- Petr
Subject: Re: [rt.cpan.org #94402] AutoReply: t/11writer.t fails randomly with perl-5.18
Date: Fri, 18 Apr 2014 14:36:37 +0200
To: Bugs in BZ-Client via RT <bug-BZ-Client [...] rt.cpan.org>
From: Petr Pisar <ppisar [...] redhat.com>
On Thu, Apr 03, 2014 at 09:15:08AM -0400, Bugs in BZ-Client via RT wrote: Show quoted text
> This subtree content has random ordering of member elements: > > <struct> > <member> > <name>b</name> > <value>xyz</value> > </member> > <member> > <name>a</name> > <value><i4>0</i4></value> > </member> > </struct> >
Attached patch fixes it. -- Petr
From e3f477126292acf944b39b755e6212ed3ffc3212 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com> Date: Fri, 18 Apr 2014 14:31:32 +0200 Subject: [PATCH] Expect perturbed structure members on t/11writer.t MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit According to the XML-RPC specification, key order in structure is not significant. CPAN RT#94402 Signed-off-by: Petr Písař <ppisar@redhat.com> --- t/11writer.t | 41 +++++++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/t/11writer.t b/t/11writer.t index a0f79e7..a04bb27 100755 --- a/t/11writer.t +++ b/t/11writer.t @@ -28,7 +28,17 @@ sub TestBasic() { scalar($now), { "a" => BZ::Client::XMLRPC::int->new(0), "b" => "xyz" } ]; my $contents = $xmlrpc->create_request("someMethod", $input); - my $expect = + my $membera = + "<member>" + . "<name>a</name>" + . "<value><i4>0</i4></value>" + . "</member>"; + my $memberb = + "<member>" + . "<name>b</name>" + . "<value>xyz</value>" + . "</member>"; + my $prefix = "<methodCall>" . "<methodName>someMethod</methodName>" . "<params>" @@ -49,26 +59,25 @@ sub TestBasic() { . "<param><value><dateTime.iso8601>2011-09-19T17:09:03Z</dateTime.iso8601></value></param>" . "<param>" . "<value>" - . "<struct>" - . "<member>" - . "<name>a</name>" - . "<value><i4>0</i4></value>" - . "</member>" - . "<member>" - . "<name>b</name>" - . "<value>xyz</value>" - . "</member>" - . "</struct>" + . "<struct>"; + my $suffix = + "</struct>" . "</value>" . "</param>" . "</params>" ."</methodCall>\n"; - if ($contents ne $expect) { - print STDERR "Expect: $expect\n"; - print STDERR "Got: $contents\n"; - return 0; + my $expect; + $expect = $prefix . $membera . $memberb . $suffix; + if ($contents eq $expect) { + return 1; } - return 1; + $expect = $prefix . $memberb . $membera . $suffix; + if ($contents eq $expect) { + return 1; + } + print STDERR "Expect: $expect\n"; + print STDERR "Got: $contents\n"; + return 0; } sub TestGetProducts() { -- 1.9.0
Download (untitled)
application/pgp-signature 230b

Message body not shown because it is not plain text.

this is corrected in 4.4