From 61caf66f1b002105e5603fba030de57d445330a8 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Tue, 4 Oct 2022 16:05:55 +0900 Subject: [PATCH] Fix test failure on Linux if tz database is not available --- src/util_test.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/util_test.cc b/src/util_test.cc index 0a609947..6c31e157 100644 --- a/src/util_test.cc +++ b/src/util_test.cc @@ -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",