Skip Menu |

This queue is for tickets about the Imager CPAN distribution.

Report information
The Basics
Id: 16731
Status: resolved
Priority: 0/
Queue: Imager

People
Owner: TONYC [...] cpan.org
Requestors: martin [...] sluka.de
Cc:
AdminCc:

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



Subject: t/t35ttfont does not work if $ENV{LANG} ne 'C'
When running the test suite with LANG=de_DE@euro, I get the following error: t/t35ttfont.......NOK 64# Failed test (t/t35ttfont.t at line 229) # got: 'Ungültiges Dateiformat.' # expected: 'Invalid file format.' # Looks like you failed 1 tests of 71. The already included setting of $ENV{LANG} = "C" within this test script does not seem to help, even not if put into a begin block at the top of the script. However, the test passes if I set this environment variable before starting the script. Regards, fany
Hi, Thanks for reporting this. The problem was a missing call to setlocale(), though with setlocale() it's possible to skip setting the environment at all. I'll close this issue when 0.48 is released. The following change will go into 0.48: Index: t/t35ttfont.t =================================================================== --- t/t35ttfont.t (Revision 869) +++ t/t35ttfont.t (Arbeitskopie) @@ -222,12 +222,16 @@ { # Ticket #14804 Imager::Font->new() doesn't report error details # when using freetype 1 - my $old_lang = $ENV{LANG}; - $ENV{LANG} = "C"; + # make sure we're using C locale for messages + use POSIX qw(setlocale LC_ALL); + setlocale(LC_ALL, "C"); + my $font = Imager::Font->new(file=>'t/t35ttfont.t', type=>'tt'); ok(!$font, "font creation should have failed for invalid file"); cmp_ok(Imager->errstr, 'eq', 'Invalid file format.', "test error message"); + + setlocale(LC_ALL, ""); } { # check errstr set correctly (0.47 was released today to fix a crash bug.)
On Mon Dec 26 02:21:04 2005, FANY wrote: Show quoted text
> When running the test suite with LANG=de_DE@euro, I get the following > error: > > t/t35ttfont.......NOK 64# Failed test (t/t35ttfont.t at line 229) > # got: 'Ungültiges Dateiformat.' > # expected: 'Invalid file format.' > # Looks like you failed 1 tests of 71. >
Hi, Imager 0.47_01 should now be available on your CPAN mirror. This should fix your issue. If you get a chance please try testing it to check if your issue is solved, if you're using the CPAN shell you can do: test T/TO/TONYC/Imager-0.47_01.tar.gz Thanks, Tony Cook
Subject: Re: [rt.cpan.org #16731] t/t35ttfont does not work if $ENV{LANG} ne 'C'
Date: Mon, 27 Feb 2006 13:18:31 +0100
To: via RT <bug-Imager [...] rt.cpan.org>
From: "Martin H. Sluka" <martin [...] sluka.de>
Hi, Show quoted text
> test T/TO/TONYC/Imager-0.47_01.tar.gz
"All tests successful, 2 tests and 38 subtests skipped." Thanks a lot! Regards, fany -- _________________________________________ _ Martin H. Sluka \ tel +49-700-19751024 / ASCII ribbon ( ) Breite Straße 3 \ <martin@sluka.de> / campaign - against X D-90552 Röthenbach \ <http://unf.ug/> / HTML email & vcards / \