Skip Menu |

This queue is for tickets about the threads-shared CPAN distribution.

Report information
The Basics
Id: 99960
Status: resolved
Priority: 0/
Queue: threads-shared

People
Owner: Nobody in particular
Requestors: g.grigelionis [...] gmail.com
Cc:
AdminCc:

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



Subject: Incomplete tests in threads::shared?
Date: Sat, 1 Nov 2014 21:36:33 +0100
To: bug-threads-shared [...] rt.cpan.org
From: Gintautas Grigelionis <g.grigelionis [...] gmail.com>
Hi, I noticed that List::Utils and threads::shared both test dualvar; the former fails on perl 5.8 because integer numeric part of dualvars appears nulled, but the latter succeeds! The only difference is that List::Utils checks the shared dualvar right away, but threads::shared tests passes shared dualvar into a sub. I suspect that some magic happens in threads::shared... or are the tests incomplete? Regards, Gintas
On 2014-11-01 16:36:43, g.grigelionis@gmail.com wrote: Show quoted text
> Hi, > > I noticed that List::Utils and threads::shared both test dualvar; > the former fails on perl 5.8 because integer numeric part of dualvars > appears nulled, > but the latter succeeds! > > The only difference is that List::Utils checks the shared dualvar right > away, > but threads::shared tests passes shared dualvar into a sub. > > I suspect that some magic happens in threads::shared... or are the tests > incomplete? > > Regards, > Gintas
To my knowledge, the tests are complete, unless you can point out how they might be otherwise.
Subject: Re: [rt.cpan.org #99960] Incomplete tests in threads::shared?
Date: Sun, 2 Nov 2014 19:27:27 +0100
To: bug-threads-shared [...] rt.cpan.org
From: Gintautas Grigelionis <g.grigelionis [...] gmail.com>
If I my understanding is correct, variables passed to sub are copies, not references. So tests in threads::shared do not compare the same thing as List::Utils does. I lack the knowledge to figure out why this difference matters in 5.8 but not in newer Perls. In any case, threads::shared should test the same thing as List::Utils and either desupport 5.8 or fix share().
Subject: Re: [rt.cpan.org #99960] Incomplete tests in threads::shared?
Date: Sat, 6 Dec 2014 08:32:44 +0100
To: bug-threads-shared [...] rt.cpan.org
From: Gintautas Grigelionis <g.grigelionis [...] gmail.com>
This is a patch that starts failing the test on Perl 5.8 (as it should, IMHO) *** dualvar.t Sat Dec 6 08:14:29 2014 --- dualvar.t~ Tue Feb 4 22:54:25 2014 *************** *** 39,61 **** sub ok_iv { my ($var, $iv) = @_; ! ok($$var == $$iv, 'IV number preserved'); ! ok($$var eq $$iv, 'String preserved'); } sub ok_nv { my ($var, $nv) = @_; ! ok($$var == $$nv, 'NV number preserved'); ! ok($$var eq $$nv, 'String preserved'); } sub ok_uv { my ($var, $uv) = @_; ! ok($$var == $$uv, 'UV number preserved'); ! ok($$var > 0, 'UV number preserved'); ! ok($$var eq $$uv, 'String preserved'); } ### Start of Testing ### --- 39,61 ---- sub ok_iv { my ($var, $iv) = @_; ! ok($var == $iv, 'IV number preserved'); ! ok($var eq $iv, 'String preserved'); } sub ok_nv { my ($var, $nv) = @_; ! ok($var == $nv, 'NV number preserved'); ! ok($var eq $nv, 'String preserved'); } sub ok_uv { my ($var, $uv) = @_; ! ok($var == $uv, 'UV number preserved'); ! ok($var > 0, 'UV number preserved'); ! ok($var eq $uv, 'String preserved'); } ### Start of Testing ### *************** *** 71,79 **** my $snv :shared = shared_clone($nv); my $suv :shared = shared_clone($uv); ! ok_iv(\$siv, \$iv); ! ok_nv(\$snv, \$nv); ! ok_uv(\$suv, \$uv); { print("# Shared array initialization\n"); --- 71,79 ---- my $snv :shared = shared_clone($nv); my $suv :shared = shared_clone($uv); ! ok_iv($siv, $iv); ! ok_nv($snv, $nv); ! ok_uv($suv, $uv); { print("# Shared array initialization\n"); 2014-11-02 19:27 GMT+01:00 Gintautas Grigelionis <g.grigelionis@gmail.com>: Show quoted text
> If I my understanding is correct, variables passed to sub are copies, not > references. > So tests in threads::shared do not compare the same thing as List::Utils > does. > I lack the knowledge to figure out why this difference matters in 5.8 but > not in newer Perls. > In any case, threads::shared should test the same thing as List::Utils and > either desupport 5.8 or fix share(). >