Which is weird because dumpbin shows strftime() being imported from the right place.

Yes - it's being imported from the right place .... therefore we deduce that the timezone is not being set as intended. I added 3 warn() messages to the relevant section of the 02core.t script. It now looks like:
SKIP: { skip "can't register TZ changes in a pseudo-fork", 2 if $is_pseudo +_fork; use POSIX; warn "1 POSIX::strftime: ", POSIX::strftime("%Z\n", localtime); local $ENV{TZ} = "EST5"; warn "2 POSIX::strftime: ", POSIX::strftime("%Z\n", localtime); Time::Piece::_tzset(); # register the environment change warn "3 POSIX::strftime: ", POSIX::strftime("%Z\n", localtime); my $lt = localtime; cmp_ok(scalar($lt->tzoffset), 'eq', '-18000'); cmp_ok($lt->strftime("%Z"), 'eq', 'EST'); }
Using VC 7 and a perl-5.10.0 built by VC 7 everything works fine and the modified script outputs (as desired):
. . ok 37 1 POSIX::strftime: AUS Eastern Daylight Time 2 POSIX::strftime: EST 3 POSIX::strftime: EST ok 38 ok 39 ok 40 . .
But using VC 7 with ActivePerl-5.10.1 (or with ActivePerl-5.10.0), the output becomes:
. . ok 37 1 POSIX::strftime: AUS Eastern Daylight Time 2 POSIX::strftime: AUS Eastern Daylight Time 3 POSIX::strftime: AUS Eastern Daylight Time ok 38 not ok 39 # Failed test at t/02core.t line 65. # got: '' # expected: 'EST' ok 40 . .
Apparently for this test to work with MSVC++ 7.0 on a perl built by MSVC++ 6, the Time::Piece authors need to devise a way of getting the change to $ENV{TZ} reflected in the right place so that their strtftime call can detect it.

Cheers,
Rob

In reply to Re^16: Testing Time::Piece on Windows/VC by syphilis
in thread Testing Time::Piece on Windows/VC by Corion

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.