diff mbox

[libgo] : Fix FAIL: time testsuite failure

Message ID CAFULd4YUCsQZDy4OW0=d+c3ckkydzaovF9q-Bm4mjk1L=RG4NQ@mail.gmail.com
State New
Headers show

Commit Message

Uros Bizjak Oct. 18, 2016, 9:19 a.m. UTC
The name of Etc/GMT+1 timezone is "-01", as evident from:

$ TZ=Etc/GMT+1 date +%Z
-01

Attached patch fixes the testsuite failure.

Uros.

Comments

Uros Bizjak Oct. 18, 2016, 12:10 p.m. UTC | #1
On Tue, Oct 18, 2016 at 11:19 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
> The name of Etc/GMT+1 timezone is "-01", as evident from:
>
> $ TZ=Etc/GMT+1 date +%Z
> -01
>
> Attached patch fixes the testsuite failure.

Forgot to say that the patch was tested with tzdata2016g on Fedora 24
and CentOS 5.11.

Uros.
Uros Bizjak Oct. 18, 2016, 12:14 p.m. UTC | #2
On Tue, Oct 18, 2016 at 2:10 PM, Uros Bizjak <ubizjak@gmail.com> wrote:
> On Tue, Oct 18, 2016 at 11:19 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
>> The name of Etc/GMT+1 timezone is "-01", as evident from:
>>
>> $ TZ=Etc/GMT+1 date +%Z
>> -01
>>
>> Attached patch fixes the testsuite failure.
>
> Forgot to say that the patch was tested with tzdata2016g on Fedora 24
> and CentOS 5.11.

FYI, tzdata2016g ChangLog says:

  Changes to past and future time zone abbreviations

    The Factory zone now uses the time zone abbreviation -00 instead
    of a long English-language string, as -00 is now the normal way to
    represent an undefined time zone.

    Several zones in Antarctica and the former Soviet Union, along
    with zones intended for ships at sea that cannot use POSIX TZ
    strings, now use numeric time zone abbreviations instead of
    invented or obsolete alphanumeric abbreviations.  The affected
    zones are Antarctica/Casey, Antarctica/Davis,
    Antarctica/DumontDUrville, Antarctica/Mawson, Antarctica/Rothera,
    Antarctica/Syowa, Antarctica/Troll, Antarctica/Vostok,
    Asia/Anadyr, Asia/Ashgabat, Asia/Baku, Asia/Bishkek, Asia/Chita,
    Asia/Dushanbe, Asia/Irkutsk, Asia/Kamchatka, Asia/Khandyga,
    Asia/Krasnoyarsk, Asia/Magadan, Asia/Omsk, Asia/Sakhalin,
    Asia/Samarkand, Asia/Srednekolymsk, Asia/Tashkent, Asia/Tbilisi,
    Asia/Ust-Nera, Asia/Vladivostok, Asia/Yakutsk, Asia/Yekaterinburg,
    Asia/Yerevan, Etc/GMT-14, Etc/GMT-13, Etc/GMT-12, Etc/GMT-11,
    Etc/GMT-10, Etc/GMT-9, Etc/GMT-8, Etc/GMT-7, Etc/GMT-6, Etc/GMT-5,
    Etc/GMT-4, Etc/GMT-3, Etc/GMT-2, Etc/GMT-1, Etc/GMT+1, Etc/GMT+2,
    Etc/GMT+3, Etc/GMT+4, Etc/GMT+5, Etc/GMT+6, Etc/GMT+7, Etc/GMT+8,
    Etc/GMT+9, Etc/GMT+10, Etc/GMT+11, Etc/GMT+12, Europe/Kaliningrad,
    Europe/Minsk, Europe/Samara, Europe/Volgograd, and
    Indian/Kerguelen.  For Europe/Moscow the invented abbreviation MSM
    was replaced by +05, whereas MSK and MSD were kept as they are not
    our invention and are widely used.

Uros.
Rainer Orth Oct. 18, 2016, 12:49 p.m. UTC | #3
Hi Uros,

> On Tue, Oct 18, 2016 at 11:19 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
>> The name of Etc/GMT+1 timezone is "-01", as evident from:
>>
>> $ TZ=Etc/GMT+1 date +%Z
>> -01
>>
>> Attached patch fixes the testsuite failure.
>
> Forgot to say that the patch was tested with tzdata2016g on Fedora 24
> and CentOS 5.11.

but Fedora 20 still returns GMT+1 here, and Solaris 10 to 12 even
Etc/GMT (where Solaris 12 also has 2016g).

	Rainer
Ian Lance Taylor Oct. 28, 2016, 8:08 p.m. UTC | #4
On Tue, Oct 18, 2016 at 2:19 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
> The name of Etc/GMT+1 timezone is "-01", as evident from:
>
> $ TZ=Etc/GMT+1 date +%Z
> -01
>
> Attached patch fixes the testsuite failure.

Thanks--I'm going to copy the change made to the master library
instead.  Will commit shortly (Than did the actual patch).

For the record this was filed as GCC PR 78144.

Ian
diff mbox

Patch

diff --git a/libgo/go/time/time_test.go b/libgo/go/time/time_test.go
index b7ebb37..694e311 100644
--- a/libgo/go/time/time_test.go
+++ b/libgo/go/time/time_test.go
@@ -939,8 +939,8 @@  func TestLoadFixed(t *testing.T) {
 	// but Go and most other systems use "east is positive".
 	// So GMT+1 corresponds to -3600 in the Go zone, not +3600.
 	name, offset := Now().In(loc).Zone()
-	if name != "GMT+1" || offset != -1*60*60 {
-		t.Errorf("Now().In(loc).Zone() = %q, %d, want %q, %d", name, offset, "GMT+1", -1*60*60)
+	if name != "-01" || offset != -1*60*60 {
+		t.Errorf("Now().In(loc).Zone() = %q, %d, want %q, %d", name, offset, "-01", -1*60*60)
 	}
 }