Skip to content

Commit

Permalink
The correct time is in fact in UTC since the test sets TZ=UTC0
Browse files Browse the repository at this point in the history
  • Loading branch information
nabijaczleweli authored and flatcap committed Aug 20, 2023
1 parent ffea731 commit 48cfc5d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions test/date/mutt_date_localtime_format.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void test_mutt_date_localtime_format(void)
{
// size_t mutt_date_localtime_format(char *buf, size_t buflen, char *format, time_t t);

setenv("TZ", "UTC", 1);
putenv("TZ=UTC0");

{
TEST_CHECK(mutt_date_localtime_format(NULL, 10, "apple", 0) == 0);
Expand All @@ -50,8 +50,6 @@ void test_mutt_date_localtime_format(void)
const char *format = "%Y-%m-%d %H:%M:%S %z";
TEST_CHECK(mutt_date_localtime_format(buf, sizeof(buf), format, t) > 0);
TEST_MSG(buf);
bool result = (mutt_str_equal(buf, "2000-06-25 12:00:00 +0100")) || // Expected result...
(mutt_str_equal(buf, "2000-06-25 11:00:00 +0000")); // but Travis seems to have locale problems
TEST_CHECK(result == true);
TEST_CHECK(mutt_str_equal(buf, "2000-06-25 11:00:00 +0000"));
}
}

0 comments on commit 48cfc5d

Please sign in to comment.