Merge pull request #1813 from nghttp2/test-fix-tz

Fix test failure on Linux if tz database is not available
This commit is contained in:
Tatsuhiro Tsujikawa 2022-10-04 17:48:32 +09:00 committed by GitHub
commit 93f1096de3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

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