Skip Menu |
Report information
Id: 132338
Status: open
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors: sisyphus <sisyphus1 [at] optusnet.com.au>
Cc:
AdminCc:

Operating System: Win32
PatchStatus: HasPatch
Severity: low
Type: HasTest
Perl Version: (no value)
Fixed In: (no value)



Date: Sun, 22 Oct 2017 00:05:24 +1100
Subject: [Win32] op/pack.t test failures on extended precision long double builds of 32-bit perl-5.27.5
From: <sisyphus1 [...] optusnet.com.au>
To: <perlbug [...] perl.org>
Download (untitled) / with headers
text/plain 426b
Ever since it has been possible to build 32-bit perl on Windows with an nvtype of (extended precision) long double, 2 of the op/pack.t tests (tests 13177 and 13180) have been failing on those builds. Patch to t/op/pack.t is attached. Note: This patch fixes t/op/pack.t for 32-bit builds only. With 64-bit builds the script still crashes after the successful completion of test 518. (Something to work on.) Cheers, Rob
Download pack.t.patch
text/plain 701b

Message body is not shown because sender requested not to inline it.

RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 1017b
On Sat, 21 Oct 2017 13:36:12 GMT, sisyphus wrote: Show quoted text
> Ever since it has been possible to build 32-bit perl on Windows with > an > nvtype of (extended precision) long double, 2 of the op/pack.t tests > (tests > 13177 and 13180) have been failing on those builds. > > Patch to t/op/pack.t is attached. > > Note: This patch fixes t/op/pack.t for 32-bit builds only. With 64-bit > builds the script still crashes after the successful completion of > test 518. > (Something to work on.) > > Cheers, > Rob
There are nearly 15,000 unit tests in t/op/pack.t, most of them lacking descriptions. I took the liberty of adding descriptions to the tests in the relevant block simply so I and other readers would not get lost in the output. However, before I apply it, I want to ask the list: Is there any reason to believe that applying this patch would have a negative impact on tests on any other platform (including other configurations of Windows)? Thank you very much. Jim Keenan -- James E Keenan (jkeenan@cpan.org)
Subject: 132338-0001-32-bit-perl-on-Windows-with-nytype-of-extended-preci.patch
From a970be27cf6308e63f2821f5339317feaeec9615 Mon Sep 17 00:00:00 2001 From: Sisyphus <sisyphus1@optusnet.com.au> Date: Mon, 23 Oct 2017 16:55:27 -0400 Subject: [PATCH] 32-bit perl on Windows with nytype of (extended precision) long double. Enable tests to pass on that platform for: struct {char c1; double d; char cc[2];} Committer: add descriptions to tests in relevant block. For: RT #132338 --- t/op/pack.t | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/t/op/pack.t b/t/op/pack.t index 919e4c5..5dde642 100644 --- a/t/op/pack.t +++ b/t/op/pack.t @@ -1410,12 +1410,13 @@ is(scalar unpack('A /A /A Z20', '3004bcde'), 'bcde'); my $t = 'C x![d] d C[2]'; my @a = (173, 1.283476517e-45, 42, 215); my $p = pack $t, @a; - ok( length $p); + ok( length $p, "Packed string has nonzero length"); my @b = unpack "$t X[$t] $t", $p; # Extract, step back, extract again - is(scalar @b, 2 * scalar @a); + is(scalar @b, 2 * scalar @a, + "Array unpacked per template has twice number of elements as original array"); $b = "@b"; - $b =~ s/(?:17000+|16999+)\d+(e-45) /17$1 /gi; # stringification is gamble - is($b, "@a @a"); + $b =~ s/(?:17000+|16999+)\d+(e-0?45) /17$1 /gi; # stringification is gamble + is($b, "@a @a", "Got expected stringification of unpacked array"); use warnings qw(NONFATAL all);; my $warning; @@ -1424,11 +1425,12 @@ is(scalar unpack('A /A /A Z20', '3004bcde'), 'bcde'); }; @b = unpack "x[C] x[$t] X[$t] X[C] $t", "$p\0"; - is($warning, undef); - is(scalar @b, scalar @a); + is($warning, undef, "Got no warning from unpack, as expected"); + is(scalar @b, scalar @a, + "Array unpacked per second template has same number of elements as original array"); $b = "@b"; - $b =~ s/(?:17000+|16999+)\d+(e-45) /17$1 /gi; # stringification is gamble - is($b, "@a"); + $b =~ s/(?:17000+|16999+)\d+(e-0?45) /17$1 /gi; # stringification is gamble + is($b, "@a", "Got expected stringification of unpacked array"); } is(length(pack("j", 0)), $Config{ivsize}); -- 2.7.4
To: <perlbug-followup [...] perl.org>
Date: Tue, 24 Oct 2017 08:58:56 +1100
From: <sisyphus1 [...] optusnet.com.au>
Subject: Re: [perl #132338] [Win32] op/pack.t test failures on extended precision long double builds of 32-bit perl-5.27.5
Download (untitled) / with headers
text/plain 2.3k
Show quoted text
-----Original Message----- From: James E Keenan via RT Sent: Tuesday, October 24, 2017 8:05 AM To: sisyphus1@optusnet.com.au Subject: [perl #132338] [Win32] op/pack.t test failures on extended precision long double builds of 32-bit perl-5.27.5
> However, before I apply it, I want to ask the list: Is there any reason > to believe that applying this patch would have a negative impact on tests > on any other platform (including other configurations of Windows)?
========= Elaboration ========= on windows, (with extended precision long double) the string looks like: 173 1.28347651700000004e-045 42 215 173 1.28347651700000004e-045 42 215 on many other systems, (with extended precision long double) the string looks like: 173 1.28347651700000004e-45 42 215 173 1.28347651700000004e-45 42 215 The tests pass iff that string is modified to: on windows: 173 1.283476517e-045 42 215 173 1.283476517e-045 42 215 on many other systems: 173 1.283476517e-45 42 215 173 1.283476517e-45 42 215 The original regex does the job for "many other systems" but not for Windows. The modified regex does the job for both categories: ######################################## use warnings; use strict; my $nix = "173 1.28347651700000004e-45 42 215 173 1.28347651700000004e-45 42 215"; my $win = "173 1.28347651700000004e-045 42 215 173 1.28347651700000004e-045 42 215"; $nix =~ s/(?:17000+|16999+)\d+(e-45) /17$1 /gi; print "Original regex (nix): $nix\n"; $win =~ s/(?:17000+|16999+)\d+(e-45) /17$1 /gi; print "Original regex (win): $win\n\n"; $nix = "173 1.28347651700000004e-45 42 215 173 1.28347651700000004e-45 42 215"; $win = "173 1.28347651700000004e-045 42 215 173 1.28347651700000004e-045 42 215"; $nix =~ s/(?:17000+|16999+)\d+(e-0?45) /17$1 /gi; print "Modified regex (nix): $nix\n"; $win =~ s/(?:17000+|16999+)\d+(e-0?45) /17$1 /gi; print "Modified regex (win): $win\n"; ######################################## Outputs: ######################################## Original regex (nix): 173 1.283476517e-45 42 215 173 1.283476517e-45 42 215 Original regex (win): 173 1.28347651700000004e-045 42 215 173 1.28347651700000004e-045 42 215 Modified regex (nix): 173 1.283476517e-45 42 215 173 1.283476517e-45 42 215 Modified regex (win): 173 1.283476517e-045 42 215 173 1.283476517e-045 42 215 ######################################## Cheers, Rob


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

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org