From ce6bda69189e9f4ff278a5e181691cd695f753ae Mon Sep 17 00:00:00 2001 From: Shenghou Ma Date: Sun, 24 May 2015 02:44:32 -0400 Subject: [PATCH] ocsp: fix test on TZ=UTC systems If the system is using UTC, then time.Now().loc != time.UTC().loc, so it should not use reflect.DeepEqual to compare two times. While we're here, also fix some copy-paste errors. Change-Id: I1fef5f22f5b5eb978746d2695a1b43f153e4a408 Reviewed-on: https://go-review.googlesource.com/10335 Reviewed-by: Adam Langley --- ocsp/ocsp_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ocsp/ocsp_test.go b/ocsp/ocsp_test.go index 449588c..4ba0eda 100644 --- a/ocsp/ocsp_test.go +++ b/ocsp/ocsp_test.go @@ -194,11 +194,11 @@ func TestOCSPResponse(t *testing.T) { } if !reflect.DeepEqual(resp.RevokedAt, template.RevokedAt) { - t.Errorf("resp.NextUpdate: got %d, want %d", resp.NextUpdate, template.NextUpdate) + t.Errorf("resp.RevokedAt: got %d, want %d", resp.RevokedAt, template.RevokedAt) } - if !reflect.DeepEqual(resp.ProducedAt, producedAt) { - t.Errorf("resp.NextUpdate: got %d, want %d", resp.NextUpdate, template.NextUpdate) + if !resp.ProducedAt.Equal(producedAt) { + t.Errorf("resp.ProducedAt: got %d, want %d", resp.ProducedAt, producedAt) } if resp.Status != template.Status {