From 962b18411893e1fffd10c2b6370ac34aba62f146 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Tue, 23 Feb 2016 14:07:01 -0500 Subject: Updating golang dependancies (godep) --- .../src/gopkg.in/asn1-ber.v1/header_test.go | 135 --------------------- 1 file changed, 135 deletions(-) delete mode 100644 Godeps/_workspace/src/gopkg.in/asn1-ber.v1/header_test.go (limited to 'Godeps/_workspace/src/gopkg.in/asn1-ber.v1/header_test.go') diff --git a/Godeps/_workspace/src/gopkg.in/asn1-ber.v1/header_test.go b/Godeps/_workspace/src/gopkg.in/asn1-ber.v1/header_test.go deleted file mode 100644 index cac1e2e2b..000000000 --- a/Godeps/_workspace/src/gopkg.in/asn1-ber.v1/header_test.go +++ /dev/null @@ -1,135 +0,0 @@ -package ber - -import ( - "bytes" - "io" - "testing" -) - -func TestReadHeader(t *testing.T) { - testcases := map[string]struct { - Data []byte - ExpectedIdentifier Identifier - ExpectedLength int - ExpectedBytesRead int - ExpectedError string - }{ - "empty": { - Data: []byte{}, - ExpectedIdentifier: Identifier{}, - ExpectedLength: 0, - ExpectedBytesRead: 0, - ExpectedError: io.ErrUnexpectedEOF.Error(), - }, - - "valid short form": { - Data: []byte{ - byte(ClassUniversal) | byte(TypePrimitive) | byte(TagCharacterString), - 127, - }, - ExpectedIdentifier: Identifier{ - ClassType: ClassUniversal, - TagType: TypePrimitive, - Tag: TagCharacterString, - }, - ExpectedLength: 127, - ExpectedBytesRead: 2, - ExpectedError: "", - }, - - "valid long form": { - Data: []byte{ - // 2-byte encoding of tag - byte(ClassUniversal) | byte(TypePrimitive) | byte(HighTag), - byte(TagCharacterString), - - // 2-byte encoding of length - LengthLongFormBitmask | 1, - 127, - }, - ExpectedIdentifier: Identifier{ - ClassType: ClassUniversal, - TagType: TypePrimitive, - Tag: TagCharacterString, - }, - ExpectedLength: 127, - ExpectedBytesRead: 4, - ExpectedError: "", - }, - - "valid indefinite length": { - Data: []byte{ - byte(ClassUniversal) | byte(TypeConstructed) | byte(TagCharacterString), - LengthLongFormBitmask, - }, - ExpectedIdentifier: Identifier{ - ClassType: ClassUniversal, - TagType: TypeConstructed, - Tag: TagCharacterString, - }, - ExpectedLength: LengthIndefinite, - ExpectedBytesRead: 2, - ExpectedError: "", - }, - - "invalid indefinite length": { - Data: []byte{ - byte(ClassUniversal) | byte(TypePrimitive) | byte(TagCharacterString), - LengthLongFormBitmask, - }, - ExpectedIdentifier: Identifier{}, - ExpectedLength: 0, - ExpectedBytesRead: 2, - ExpectedError: "indefinite length used with primitive type", - }, - } - - for k, tc := range testcases { - reader := bytes.NewBuffer(tc.Data) - identifier, length, read, err := readHeader(reader) - - if err != nil { - if tc.ExpectedError == "" { - t.Errorf("%s: unexpected error: %v", k, err) - } else if err.Error() != tc.ExpectedError { - t.Errorf("%s: expected error %v, got %v", k, tc.ExpectedError, err) - } - } else if tc.ExpectedError != "" { - t.Errorf("%s: expected error %v, got none", k, tc.ExpectedError) - continue - } - - if read != tc.ExpectedBytesRead { - t.Errorf("%s: expected read %d, got %d", k, tc.ExpectedBytesRead, read) - } - - if identifier.ClassType != tc.ExpectedIdentifier.ClassType { - t.Errorf("%s: expected class type %d (%s), got %d (%s)", k, - tc.ExpectedIdentifier.ClassType, - ClassMap[tc.ExpectedIdentifier.ClassType], - identifier.ClassType, - ClassMap[identifier.ClassType], - ) - } - if identifier.TagType != tc.ExpectedIdentifier.TagType { - t.Errorf("%s: expected tag type %d (%s), got %d (%s)", k, - tc.ExpectedIdentifier.TagType, - TypeMap[tc.ExpectedIdentifier.TagType], - identifier.TagType, - TypeMap[identifier.TagType], - ) - } - if identifier.Tag != tc.ExpectedIdentifier.Tag { - t.Errorf("%s: expected tag %d (%s), got %d (%s)", k, - tc.ExpectedIdentifier.Tag, - tagMap[tc.ExpectedIdentifier.Tag], - identifier.Tag, - tagMap[identifier.Tag], - ) - } - - if length != tc.ExpectedLength { - t.Errorf("%s: expected length %d, got %d", k, tc.ExpectedLength, length) - } - } -} -- cgit v1.2.3-1-g7c22