From b23d8b26c44612b5a942bf5660995400a4384035 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Tue, 12 Jul 2016 13:19:53 +0200 Subject: [PATCH] Work around test failures due to timestamps being unsigned long Git's source code refers to timestamps as unsigned longs. On 32-bit platforms, as well as on Windows, unsigned long is not large enough to capture dates that are "absurdly far in the future". While we will fix this issue properly by replacing unsigned long -> time_t, on the maint track we want to be a bit more conservative and just skip those tests. Signed-off-by: Johannes Schindelin --- t/t0006-date.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/t/t0006-date.sh b/t/t0006-date.sh index 04ce53509c..d1856402b7 100755 --- a/t/t0006-date.sh +++ b/t/t0006-date.sh @@ -48,10 +48,17 @@ check_show default "$TIME" 'Wed Jun 15 16:13:20 2016 +0200' check_show raw "$TIME" '1466000000 +0200' check_show iso-local "$TIME" '2016-06-15 14:13:20 +0000' -# arbitrary time absurdly far in the future -FUTURE="5758122296 -0400" -check_show iso "$FUTURE" "2152-06-19 18:24:56 -0400" -check_show iso-local "$FUTURE" "2152-06-19 22:24:56 +0000" +case "$(test-date show:iso 9999999999)" in +*2038*) + # on this platform, unsigned long is 32-bit, i.e. not large enough + ;; +*) + # arbitrary time absurdly far in the future + FUTURE="5758122296 -0400" + check_show iso "$FUTURE" "2152-06-19 18:24:56 -0400" + check_show iso-local "$FUTURE" "2152-06-19 22:24:56 +0000" + ;; +esac check_parse() { echo "$1 -> $2" >expect