summaryrefslogtreecommitdiffstats
path: root/libgo/go/encoding/asn1/marshal_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/encoding/asn1/marshal_test.go')
-rw-r--r--libgo/go/encoding/asn1/marshal_test.go14
1 files changed, 6 insertions, 8 deletions
diff --git a/libgo/go/encoding/asn1/marshal_test.go b/libgo/go/encoding/asn1/marshal_test.go
index 03df5f1e1d5..d05b5d8d4e9 100644
--- a/libgo/go/encoding/asn1/marshal_test.go
+++ b/libgo/go/encoding/asn1/marshal_test.go
@@ -51,10 +51,7 @@ type optionalRawValueTest struct {
type testSET []int
-func setPST(t *time.Time) *time.Time {
- t.ZoneOffset = -28800
- return t
-}
+var PST = time.FixedZone("PST", -8*60*60)
type marshalTest struct {
in interface{}
@@ -73,9 +70,9 @@ var marshalTests = []marshalTest{
{[]byte{1, 2, 3}, "0403010203"},
{implicitTagTest{64}, "3003850140"},
{explicitTagTest{64}, "3005a503020140"},
- {time.SecondsToUTC(0), "170d3730303130313030303030305a"},
- {time.SecondsToUTC(1258325776), "170d3039313131353232353631365a"},
- {setPST(time.SecondsToUTC(1258325776)), "17113039313131353232353631362d30383030"},
+ {time.Unix(0, 0).UTC(), "170d3730303130313030303030305a"},
+ {time.Unix(1258325776, 0).UTC(), "170d3039313131353232353631365a"},
+ {time.Unix(1258325776, 0).In(PST), "17113039313131353232353631362d30383030"},
{BitString{[]byte{0x80}, 1}, "03020780"},
{BitString{[]byte{0x81, 0xf0}, 12}, "03030481f0"},
{ObjectIdentifier([]int{1, 2, 3, 4}), "06032a0304"},
@@ -123,7 +120,8 @@ func TestMarshal(t *testing.T) {
}
out, _ := hex.DecodeString(test.out)
if bytes.Compare(out, data) != 0 {
- t.Errorf("#%d got: %x want %x", i, data, out)
+ t.Errorf("#%d got: %x want %x\n\t%q\n\t%q", i, data, out, data, out)
+
}
}
}
OpenPOWER on IntegriCloud