]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Do not use legacy time zone names
authorMichał Kępień <michal@isc.org>
Tue, 30 Jul 2019 19:08:40 +0000 (21:08 +0200)
committerMichał Kępień <michal@isc.org>
Tue, 30 Jul 2019 19:25:47 +0000 (21:25 +0200)
"PST8PDT" is a legacy time zone name whose use in modern code is
discouraged.  It so happens that using this time zone with musl libc
time functions results in different output than for other libc
implementations, which breaks the lib/isc/tests/time_test unit test.
Use the "America/Los_Angeles" time zone instead in order to get
consistent output across all tested libc implementations.

(cherry picked from commit f4daf6e0e7d4f347242392fbf3d585707c831b5a)

lib/isc/tests/time_test.c

index 101bb57fbc5b0624073acd57e5d90b02ccc13387..05f8f531c62bc15be1089e89ad4f7e02f03acaab 100644 (file)
@@ -38,7 +38,7 @@ isc_time_parsehttptimestamp_test(void **state) {
 
        UNUSED(state);
 
-       setenv("TZ", "PST8PDT", 1);
+       setenv("TZ", "America/Los_Angeles", 1);
        result = isc_time_now(&t);
        assert_int_equal(result, ISC_R_SUCCESS);
 
@@ -57,7 +57,7 @@ isc_time_formatISO8601_test(void **state) {
 
        UNUSED(state);
 
-       setenv("TZ", "PST8PDT", 1);
+       setenv("TZ", "America/Los_Angeles", 1);
        result = isc_time_now(&t);
        assert_int_equal(result, ISC_R_SUCCESS);
 
@@ -93,7 +93,7 @@ isc_time_formatISO8601ms_test(void **state) {
 
        UNUSED(state);
 
-       setenv("TZ", "PST8PDT", 1);
+       setenv("TZ", "America/Los_Angeles", 1);
        result = isc_time_now(&t);
        assert_int_equal(result, ISC_R_SUCCESS);
 
@@ -130,7 +130,7 @@ isc_time_formatISO8601L_test(void **state) {
 
        UNUSED(state);
 
-       setenv("TZ", "PST8PDT", 1);
+       setenv("TZ", "America/Los_Angeles", 1);
        result = isc_time_now(&t);
        assert_int_equal(result, ISC_R_SUCCESS);
 
@@ -165,7 +165,7 @@ isc_time_formatISO8601Lms_test(void **state) {
 
        UNUSED(state);
 
-       setenv("TZ", "PST8PDT", 1);
+       setenv("TZ", "America/Los_Angeles", 1);
        result = isc_time_now(&t);
        assert_int_equal(result, ISC_R_SUCCESS);
 
@@ -201,7 +201,7 @@ isc_time_formatshorttimestamp_test(void **state) {
 
        UNUSED(state);
 
-       setenv("TZ", "PST8PDT", 1);
+       setenv("TZ", "America/Los_Angeles", 1);
        result = isc_time_now(&t);
        assert_int_equal(result, ISC_R_SUCCESS);