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 <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin
2016-07-12 13:19:53 +02:00
parent dda2687949
commit b23d8b26c4

View File

@@ -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