[patch] KTimezone tests

David Jarvie lists at astrojar.org.uk
Thu Dec 29 13:34:18 GMT 2005


On Wednesday 28 December 2005 23:34, Brad Hards wrote:
> On Wednesday 28 December 2005 22:58 pm, David Jarvie wrote:
> > > qttest: Can't open /etc/timezone
> > > qttest: Can't open /etc/default/init
> > > FAIL!  : KTimezonesTest::currentOffset() Compared values are not the
> > > same Actual (local->currentOffset(Qt::UTC)): -18000
> > >    Expected (offset): 39600
> > >    Loc:
> > > [/home/bradh/coding/KDE/kdelibs/kdecore/tests/ktimezonestest.cpp(125)]
> >
> > What system are you running?
>
> Fedora Core 4
>
> > Do you have a /etc/localtime file? If so, is it a link or a normal file?
>
> Normal file, binary format. On my system it comes from the glibc package.
>
> > Is /usr/share/zoneinfo non-empty?
>
> It contains a range of files and directories.
>
> > What time zone is displayed when you type 'date'?
>
> [bradh at marginata ~]$ date +%Z
> EST
>
> The date on this box isn't accurate, but the output of 'date' is 11 hours
> ahead of the output of 'date -u', which is correct.

It looks like KSystemTimezones::local() for some reason isn't finding a match 
between your /etc/localtime and any of the files in /usr/share/zoneinfo. (The 
file should have the same contents as one of the zoneinfo files.) This 
presumably is due either to there being no matching file, or due to it not 
being listed in /usr/share/zoneinfo/zone.tab. After failing to find a match, 
the value of the TZ environment variable is used as a fallback. This ('EST') 
translates to a UTC offset of -5 hours (the -18000 which the test reports).

I don't know how much testing was done on the local time zone code, but what 
you have found suggests that there may be bugs. Perhaps Shaheed can comment?

-- 
David Jarvie.
KAlarm author and maintainer.
http://www.astrojar.org.uk/linux/kalarm.html




More information about the kde-core-devel mailing list