浏览代码

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 <agl@golang.org>
Shenghou Ma 10 年之前
父节点
当前提交
ce6bda6918
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      ocsp/ocsp_test.go

+ 3 - 3
ocsp/ocsp_test.go

@@ -194,11 +194,11 @@ func TestOCSPResponse(t *testing.T) {
 	}
 	}
 
 
 	if !reflect.DeepEqual(resp.RevokedAt, template.RevokedAt) {
 	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 {
 	if resp.Status != template.Status {