diff --git a/src/time_zone_lookup_test.cc b/src/time_zone_lookup_test.cc index 3f0d589c..60559f3d 100644 --- a/src/time_zone_lookup_test.cc +++ b/src/time_zone_lookup_test.cc @@ -1143,17 +1143,22 @@ TEST(TimeZoneEdgeCase, AmericaJamaica) { // Before the first transition. auto tp = convert(civil_second(1889, 12, 31, 0, 0, 0), tz); - ExpectTime(tp, tz, 1889, 12, 31, 0, 0, 0, -18431, false, +#if AMERICA_JAMAICA_PRE_1913_OFFSET_FIX + // Commit 907241e: Fix off-by-1 error for Jamaica and T&C before 1913. + // Until that commit has made its way into a full release we avoid the + // expectations on the -18430 offset below. TODO: Uncomment these. + ExpectTime(tp, tz, 1889, 12, 31, 0, 0, 0, -18430, false, tz.lookup(tp).abbr); // Over the first (abbreviation-change only) transition. // -2524503170 == Tue, 31 Dec 1889 23:59:59 -0507 (LMT) // -2524503169 == Wed, 1 Jan 1890 00:00:00 -0507 (KMT) tp = convert(civil_second(1889, 12, 31, 23, 59, 59), tz); - ExpectTime(tp, tz, 1889, 12, 31, 23, 59, 59, -18431, false, + ExpectTime(tp, tz, 1889, 12, 31, 23, 59, 59, -18430, false, tz.lookup(tp).abbr); tp += seconds(1); - ExpectTime(tp, tz, 1890, 1, 1, 0, 0, 0, -18431, false, "KMT"); + ExpectTime(tp, tz, 1890, 1, 1, 0, 0, 0, -18430, false, "KMT"); +#endif // Over the last (DST) transition. // 436341599 == Sun, 30 Oct 1983 01:59:59 -0400 (EDT) diff --git a/src/tzfile.h b/src/tzfile.h index 0e51dce1..f7f5cafd 100644 --- a/src/tzfile.h +++ b/src/tzfile.h @@ -20,11 +20,11 @@ */ #ifndef TZDIR -#define TZDIR "/usr/local/etc/zoneinfo" /* Time zone object file directory */ +#define TZDIR "/usr/share/zoneinfo" /* Time zone object file directory */ #endif /* !defined TZDIR */ #ifndef TZDEFAULT -#define TZDEFAULT "localtime" +#define TZDEFAULT "/etc/localtime" #endif /* !defined TZDEFAULT */ #ifndef TZDEFRULES diff --git a/testdata/README.zoneinfo b/testdata/README.zoneinfo index 36b39db6..c51165d6 100644 --- a/testdata/README.zoneinfo +++ b/testdata/README.zoneinfo @@ -21,10 +21,13 @@ New versions can be generated using the following shell script. LOCALTIME=Factory \ TZDATA_TEXT= \ ZONETABLES=zone1970.tab + tar --create --dereference --hard-dereference --file tzfile.tar \ + --directory=tz tzfile.h tar --create --dereference --hard-dereference --file zoneinfo.tar \ --exclude=zoneinfo/posixrules zoneinfo \ --directory=tz version ) + tar --extract --directory src --file ${DESTDIR}/tzfile.tar tar --extract --directory testdata --file ${DESTDIR}/zoneinfo.tar exit 0 diff --git a/testdata/version b/testdata/version index 2b0599d3..8f92ab6a 100644 --- a/testdata/version +++ b/testdata/version @@ -1 +1 @@ -2018c-2-gec1c7bf +2018c-20-ga6cc661 diff --git a/testdata/zoneinfo/America/Grand_Turk b/testdata/zoneinfo/America/Grand_Turk index a9740dae..4c8ca6f7 100644 Binary files a/testdata/zoneinfo/America/Grand_Turk and b/testdata/zoneinfo/America/Grand_Turk differ diff --git a/testdata/zoneinfo/America/Jamaica b/testdata/zoneinfo/America/Jamaica index 006689bc..7aedd262 100644 Binary files a/testdata/zoneinfo/America/Jamaica and b/testdata/zoneinfo/America/Jamaica differ diff --git a/testdata/zoneinfo/Jamaica b/testdata/zoneinfo/Jamaica index 006689bc..7aedd262 100644 Binary files a/testdata/zoneinfo/Jamaica and b/testdata/zoneinfo/Jamaica differ diff --git a/testdata/zoneinfo/Pacific/Enderbury b/testdata/zoneinfo/Pacific/Enderbury index b729b256..a3f30e5c 100644 Binary files a/testdata/zoneinfo/Pacific/Enderbury and b/testdata/zoneinfo/Pacific/Enderbury differ diff --git a/testdata/zoneinfo/Pacific/Kiritimati b/testdata/zoneinfo/Pacific/Kiritimati index 94384558..762275d3 100644 Binary files a/testdata/zoneinfo/Pacific/Kiritimati and b/testdata/zoneinfo/Pacific/Kiritimati differ