From 40acb8e9b57302cce353856a71cd8afe54f81c36 Mon Sep 17 00:00:00 2001 From: Lucas Clemente Date: Sat, 14 May 2016 13:24:38 +0200 Subject: [PATCH] minor protocol test fixes --- protocol/minmax_test.go | 1 + protocol/packet_number_test.go | 4 +++- protocol/version.go | 7 ++++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/protocol/minmax_test.go b/protocol/minmax_test.go index c1cfc933..c9fe6880 100644 --- a/protocol/minmax_test.go +++ b/protocol/minmax_test.go @@ -2,6 +2,7 @@ package protocol_test import ( "github.com/lucas-clemente/quic-go/protocol" + . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) diff --git a/protocol/packet_number_test.go b/protocol/packet_number_test.go index 5330d549..c803cee4 100644 --- a/protocol/packet_number_test.go +++ b/protocol/packet_number_test.go @@ -1,9 +1,11 @@ -package protocol +package protocol_test import ( "fmt" "math" + . "github.com/lucas-clemente/quic-go/protocol" + . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) diff --git a/protocol/version.go b/protocol/version.go index 990ee97a..b8cec3f9 100644 --- a/protocol/version.go +++ b/protocol/version.go @@ -2,8 +2,7 @@ package protocol import ( "bytes" - - "github.com/lucas-clemente/quic-go/utils" + "encoding/binary" ) // VersionNumber is a version number as int @@ -41,7 +40,9 @@ func IsSupportedVersion(v VersionNumber) bool { func init() { var b bytes.Buffer for _, v := range SupportedVersions { - utils.WriteUint32(&b, VersionNumberToTag(v)) + s := make([]byte, 4) + binary.LittleEndian.PutUint32(s, VersionNumberToTag(v)) + b.Write(s) } SupportedVersionsAsTags = b.Bytes() }