diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2023-03-03 12:07:25 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2023-03-03 19:45:32 +0900 |
commit | 8677fdc78bf252bf8f35cf20791ad11f1c5fcfff (patch) | |
tree | 356298124575639e241181cc32e625cbb579493e /src/test/test-time-util.c | |
parent | 0b20d70d1c7c190fb943dd4d1f28e6f456d2193e (diff) | |
download | systemd-8677fdc78bf252bf8f35cf20791ad11f1c5fcfff.tar.gz |
test: clear tzname[] after timezone is changed
Fixes the issue reported in fe56f21ae3943e79ce9faeb40b79c7093c50e644.
Diffstat (limited to 'src/test/test-time-util.c')
-rw-r--r-- | src/test/test-time-util.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/test/test-time-util.c b/src/test/test-time-util.c index cd4d635dfa..cec5bffd79 100644 --- a/src/test/test-time-util.c +++ b/src/test/test-time-util.c @@ -707,6 +707,7 @@ TEST(parse_timestamp) { test_parse_timestamp_one("70-01-01 09:00:01.0010 JST", 0, USEC_PER_SEC + 1000); assert_se(set_unset_env("TZ", saved_tz, true) == 0); + tzset(); } if (timezone_is_valid("America/New_York", LOG_DEBUG)) { @@ -756,6 +757,7 @@ TEST(parse_timestamp) { test_parse_timestamp_one("69-12-31 19:00:01.0010 EST", 0, USEC_PER_SEC + 1000); assert_se(set_unset_env("TZ", saved_tz, true) == 0); + tzset(); } /* -06 */ @@ -823,13 +825,12 @@ TEST(parse_timestamp) { /* without date */ assert_se(parse_timestamp("today", &today) == 0); - // FIXME: currently failing, needs to investigate the changes from https://github.com/systemd/systemd/pull/26409 - /*test_parse_timestamp_one("00:01", 0, today + USEC_PER_MINUTE); + test_parse_timestamp_one("00:01", 0, today + USEC_PER_MINUTE); test_parse_timestamp_one("00:00:01", 0, today + USEC_PER_SEC); test_parse_timestamp_one("00:00:01.001", 0, today + USEC_PER_SEC + 1000); test_parse_timestamp_one("00:00:01.0010", 0, today + USEC_PER_SEC + 1000); test_parse_timestamp_one("tomorrow", 0, today + USEC_PER_DAY); - test_parse_timestamp_one("yesterday", 0, today - USEC_PER_DAY);*/ + test_parse_timestamp_one("yesterday", 0, today - USEC_PER_DAY); /* relative */ assert_se(parse_timestamp("now", &now_usec) == 0); |