From 17499e761e8cd0fe867b5b5f3e42a71b6d45f954 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 27 Mar 2012 19:46:20 +0200 Subject: [PATCH] Fix timegm regression test. * common/t-timestuff.c (test_timegm): Change test to use January and not February or December+1. Bug spotted by Daniel Kahn Gillmor. --- common/t-timestuff.c | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/common/t-timestuff.c b/common/t-timestuff.c index d1a2c0287..ec55687c6 100644 --- a/common/t-timestuff.c +++ b/common/t-timestuff.c @@ -73,22 +73,20 @@ test_timegm (void) { -2, 0x7fffffff }, /* Note: Because we use mktime below we can only start with the day after Epoch. */ - { 1970, 1, 2, 0, 0 , 1}, - { 1970, 1, 2, 0, 0 , 2}, - { 1970, 1, 2, 12, 0 , 0}, - { 1970, 1, 2, 23, 59 , 59}, - { 1999, 12, 31, 23, 59 , 59}, - { 2000, 1, 1, 0, 0, 0}, - { 2000, 1, 1, 0, 0, 1}, - { 2010, 12, 31, 23, 59 , 59}, - { 2010, 1, 1, 0, 0, 0}, - { 2010, 1, 1, 0, 0, 1}, - /* The date below is about the last time mktime works in CET on - Windows XP; this is a somewhat strange because 32 bit Unices - will happily work along for another month until they reach the - end of all ticks on 20380119T031408 (unless Uli takes - compassion on us and changes time_t to a u64). */ - { 2037, 12, 18, 23, 59, 59} + { 1970, 0, 2, 0, 0 , 1}, + { 1970, 0, 2, 0, 0 , 2}, + { 1970, 0, 2, 12, 0 , 0}, + { 1970, 0, 2, 23, 59 , 59}, + { 1999, 11, 31, 23, 59 , 59}, + { 2000, 0, 1, 0, 0, 0}, + { 2000, 0, 1, 0, 0, 1}, + { 2010, 11, 31, 23, 59 , 59}, + { 2010, 0, 1, 0, 0, 0}, + { 2010, 0, 1, 0, 0, 1}, + /* On GNU based 32 bit systems the end of all ticks will be on + 20380119T031408 (unless Uli takes compassion on us and changes + time_t to a u64). We check that the previous day is okay. */ + { 2038, 0, 18, 23, 59, 59} }; int tidx;