Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Sys-Mmap CPAN distribution.

Report information
The Basics
Id: 70333
Status: resolved
Priority: 0/
Queue: Sys-Mmap

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

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



Subject: t/munmap_errors.t depends on locale
Hi. "Unmapped strings die" test in t/munmap_error.t expects English error message. I failed the test because my locale setting is Japanese, not English. I attach the patch which fix this problem. Please see it. Thanks -- Syohei YOSHIDA(syohex@gmail.com)
Subject: fix_locale_problem.patch
diff --git a/t/munmap_errors.t b/t/munmap_errors.t index e38d68c..ce76331 100644 --- a/t/munmap_errors.t +++ b/t/munmap_errors.t @@ -5,6 +5,7 @@ use warnings; use Test::More tests => 14; use Sys::Mmap; +use Errno qw(EINVAL); { my $foo; @@ -28,7 +29,7 @@ SKIP: { skip "BSD kernels can't unmap a bad pointer like linux kernels can", 4 if($^O =~ m/bsd/i || $^O =~ m/darwin/i); foreach my $foo ("", "1234", "1.232", "abcdefg" ){ eval {munmap($foo)}; - is($@, "munmap failed! errno 22 Invalid argument\n", "Unmapped strings die"); + ok($@ == EINVAL, "Unmapped strings die"); } }
Sorry previous my patch is wrong. I should check value of '$!' not '$@'. Please see new patch. On 2011-8月-18 木 01:08:41, syohex wrote: Show quoted text
> Hi. > > "Unmapped strings die" test in t/munmap_error.t expects > English error message. I failed the test because my locale > setting is Japanese, not English. > > I attach the patch which fix this problem. > Please see it. > > Thanks > > -- > Syohei YOSHIDA(syohex@gmail.com)
Subject: fix_locale_problem2.patch
diff --git a/t/munmap_errors.t b/t/munmap_errors.t index e38d68c..8dcd3ff 100644 --- a/t/munmap_errors.t +++ b/t/munmap_errors.t @@ -5,6 +5,7 @@ use warnings; use Test::More tests => 14; use Sys::Mmap; +use Errno qw(EINVAL); { my $foo; @@ -28,7 +29,7 @@ SKIP: { skip "BSD kernels can't unmap a bad pointer like linux kernels can", 4 if($^O =~ m/bsd/i || $^O =~ m/darwin/i); foreach my $foo ("", "1234", "1.232", "abcdefg" ){ eval {munmap($foo)}; - is($@, "munmap failed! errno 22 Invalid argument\n", "Unmapped strings die"); + ok($! == EINVAL, "Unmapped strings die"); } }
It's always good to get help with Locale issues. 0.15_02 is on it's way to CPAN. I'll release a production release in a week if CPAN testers doesn't show anything new. Thanks for the report!
It looks like Todd merged this code in, so I will close this ticket. Thanks for your help!