test: clear tzname[] after timezone is changed

Fixes the issue reported in fe56f21ae3.
This commit is contained in:
Yu Watanabe 2023-03-03 12:07:25 +09:00
parent 0b20d70d1c
commit 8677fdc78b

View file

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