]> git.ipfire.org Git - thirdparty/systemd.git/commit
test-time-util: skip test for TIMESTAMP_DATE if the timestamp is too old
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 1 Feb 2023 19:36:29 +0000 (04:36 +0900)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 2 Feb 2023 09:59:59 +0000 (10:59 +0100)
commitff6db56a0131d039aab10ce27859f6972f06f447
treef7ec3f9f6e0f639624f2940177ba87b5f5b638aa
parentcf74e2e16fb06b7de9e3875c6462290998fb06bd
test-time-util: skip test for TIMESTAMP_DATE if the timestamp is too old

Follow-up for 64f3419ec1f56a93b6dd48137ca40c945fc06c59.

If the input timestamp is too old (say, 1min since 1970-01-01), then
parse_timestamp() may fail on a timezone with positive shift e.g.
JST (UTC+9). Moreover, even if parse_timestamp() succeeds, its result
'y' and 'usec_sub_unsigned(x, 2 * USEC_PER_DAY)' are both zero, and
the assertion will be triggered.

Fixes #26172.
src/test/test-time-util.c