[tz] tzcode test suite

Paul Eggert eggert at cs.ucla.edu
Fri Jan 15 01:45:22 UTC 2016


On 01/14/2016 10:18 AM, Steve Summit wrote:
>> >* Would you mind if we changed "if(" to "if (" ...
> Not at all.  (Not my style, but I truly don't care.)

OK, thanks, attached are a few followup patches. The first adjusts white 
space, the second fixes a glitch I introduced earlier.

The test cases still fail, though. I wonder why they fail for me and not 
for you?

Some more things I noticed.

testsuite.c assumes time_t is equivalent to long, by using the %ld 
printf format to print it. That's not portable. time_t might have a 
different width from long, and time_t might be unsigned. zdump.c's 
tformat function gets it right.

Adding 1900 to tm_year can overflow, if tm_year is close to INT_MAX. 
quick_timegm is full of gotchas like that. As it's not needed and is 
likely to have bugs in testing, how about if we remove it? This is in 
the 3rd attached patch.

The remaining uses of isleap have a similar problem. It would be better 
to use isleap_sum; see tzfile.h.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-testsuite.c-White-space-fixes.patch
Type: text/x-patch
Size: 18184 bytes
Desc: not available
URL: <http://mm.icann.org/pipermail/tz/attachments/20160114/51bc1e3e/0001-testsuite.c-White-space-fixes.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-testsuite.c-catchsig-Pacify-GCC-in-C11-mode.patch
Type: text/x-patch
Size: 746 bytes
Desc: not available
URL: <http://mm.icann.org/pipermail/tz/attachments/20160114/51bc1e3e/0002-testsuite.c-catchsig-Pacify-GCC-in-C11-mode.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Remove-quick_timegm-and-friends.patch
Type: text/x-patch
Size: 3215 bytes
Desc: not available
URL: <http://mm.icann.org/pipermail/tz/attachments/20160114/51bc1e3e/0003-Remove-quick_timegm-and-friends.patch>


More information about the tz mailing list