Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2)

Unified Diff: src/pkg/asn1/asn1_test.go

Issue 184080: code review 184080: asn1: fix parsing of elements after a string in a structure. (Closed)
Patch Set: code review 184080: asn1: fix parsing of elements after a string in a structure. Created 15 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/pkg/asn1/asn1.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pkg/asn1/asn1_test.go
===================================================================
--- a/src/pkg/asn1/asn1_test.go
+++ b/src/pkg/asn1/asn1_test.go
@@ -263,6 +263,11 @@
B int
}
+type TestElementsAfterString struct {
+ S string
+ A, B int
+}
+
var unmarshalTestData []unmarshalTest = []unmarshalTest{
unmarshalTest{[]byte{0x02, 0x01, 0x42}, newInt(0x42)},
unmarshalTest{[]byte{0x30, 0x08, 0x06, 0x06, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d}, &TestObjectIdentifierStruct{[]int{1, 2, 840, 113549}}},
@@ -277,6 +282,7 @@
unmarshalTest{[]byte{0x30, 0x08, 0xa1, 0x03, 0x02, 0x01, 0x01, 0x02, 0x01, 0x02}, &TestContextSpecificTags2{1, 2}},
unmarshalTest{[]byte{0x01, 0x01, 0x00}, newBool(false)},
unmarshalTest{[]byte{0x01, 0x01, 0x01}, newBool(true)},
+ unmarshalTest{[]byte{0x30, 0x0b, 0x13, 0x03, 0x66, 0x6f, 0x6f, 0x02, 0x01, 0x22, 0x02, 0x01, 0x33}, &TestElementsAfterString{"foo", 0x22, 0x33}},
}
func TestUnmarshal(t *testing.T) {
« no previous file with comments | « src/pkg/asn1/asn1.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b