Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit f80d1f9

Browse files
peffgitster
authored andcommitted
t4212: loosen far-in-future test for AIX
One of the tests in t4212 checks our behavior when we feed gmtime a date so far in the future that it gives up and returns NULL. Some implementations, like AIX, may actually just provide us a bogus result instead. It's not worth it for us to come up with heuristics that guess whether the return value is sensible or not. On good platforms where gmtime reports the problem to us with NULL, we will print the epoch value. On bad platforms, we will print garbage. But our test should be written for the lowest common denominator so that it passes everywhere. Reported-by: Charles Bailey <[email protected]> Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6654754 commit f80d1f9

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

t/t4212-log-corrupt.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,9 @@ test_expect_success 'date parser recognizes time_t overflow' '
7777
'
7878

7979
# date is within 2^63-1, but enough to choke glibc's gmtime
80-
test_expect_success 'absurdly far-in-future dates produce sentinel' '
80+
test_expect_success 'absurdly far-in-future date' '
8181
commit=$(munge_author_date HEAD 999999999999999999) &&
82-
echo "Thu Jan 1 00:00:00 1970 +0000" >expect &&
83-
git log -1 --format=%ad $commit >actual &&
84-
test_cmp expect actual
82+
git log -1 --format=%ad $commit
8583
'
8684

8785
test_done

0 commit comments

Comments
 (0)