Fix test failure on Linux if tz database is not available

This commit is contained in:
Tatsuhiro Tsujikawa 2022-10-04 16:05:55 +09:00
parent 7380ff3551
commit 61caf66f1b
1 changed files with 4 additions and 0 deletions

View File

@ -448,7 +448,11 @@ void test_util_localtime_date(void) {
if (tz) {
tz = strdup(tz);
}
#ifdef __linux__
setenv("TZ", "NZST-12:00:00:00", 1);
#else // !__linux__
setenv("TZ", ":Pacific/Auckland", 1);
#endif // !__linux__
tzset();
CU_ASSERT_STRING_EQUAL("02/Oct/2001:00:34:56 +1200",