[squeak-dev] Some failing tests in Squeak5.2alpha

Alistair Grant akgrant0710 at gmail.com
Wed Jun 13 12:52:28 UTC 2018


Hi Levente,

On Wed, 13 Jun 2018 at 14:34, Levente Uzonyi <leves at caesar.elte.hu> wrote:
>
> Hi Alistair,
>
> The everlasting debate is about the time zone. Some say it is UTC, others
> say it is whatever time zone you're in. The test is failing, because it
> expects the value for UTC, while the method it uses (#asSeconds) was
> changed to use your current time zone.

I'm running short of time, apologies for the rushed answer:

The VM returns squeak time using the local timezone, as can be seen in
the conversion from unix time to squeak time on unix platforms:


time_t convertToSqueakTime(time_t unixTime)
{
#ifdef HAVE_TM_GMTOFF
  unixTime+= localtime(&unixTime)->tm_gmtoff;
#else
# ifdef HAVE_TIMEZONE
  unixTime+= ((daylight) * 60*60) - timezone;
# else
#  error: cannot determine timezone correction
# endif
#endif
  /* Squeak epoch is Jan 1, 1901.  Unix epoch is Jan 1, 1970: 17 leap years
     and 52 non-leap years later than Squeak. */
  return unixTime + ((52*365UL + 17*366UL) * 24*60*60UL);
}


Cheers,
Alistair



> On Wed, 13 Jun 2018, Alistair Grant wrote:
>
> > Hi Levente,
> > On Wed, 13 Jun 2018 at 14:02, Levente Uzonyi <leves at caesar.elte.hu> wrote:
> >>
> >> On Wed, 13 Jun 2018, Fabio Niephaus wrote:
> >>
> >> >
> >> > Hi all,
> >> >
> >> > There might be more, but these tests fail in Squeak5.2alpha:
> >> >
> >> > DateAndTimeLeapTest>>#testAsSeconds
> >>
> >> If you can answer the question "When the Squeak epoch is?", then this can
> >> be fixed.
> >
> > 1 Jan 1901.
> >
> > (I haven't looked at the test, I'm battling with file timestamps on
> > Windows in the VM at the moment).
> >
> > HTH,
> > Alistair


More information about the Squeak-dev mailing list