use IETF QUIC transport error codes

This commit is contained in:
Marten Seemann
2019-03-06 13:19:21 +09:00
parent 966b00dd3d
commit 9c09e84765
34 changed files with 156 additions and 333 deletions

View File

@@ -6,7 +6,6 @@ import (
"io"
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/qerr"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
@@ -138,7 +137,7 @@ var _ = Describe("Header Parsing", func() {
data, err := ComposeVersionNegotiation(connID, connID, versions)
Expect(err).ToNot(HaveOccurred())
_, _, _, err = ParsePacket(data[:len(data)-2], 0)
Expect(err).To(MatchError(qerr.InvalidVersionNegotiationPacket))
Expect(err).To(MatchError("Version Negotation packet has a version list with an invalid length"))
})
It("errors if the version list is empty", func() {
@@ -149,7 +148,7 @@ var _ = Describe("Header Parsing", func() {
// remove 8 bytes (two versions), since ComposeVersionNegotiation also added a reserved version number
data = data[:len(data)-8]
_, _, _, err = ParsePacket(data, 0)
Expect(err).To(MatchError("InvalidVersionNegotiationPacket: empty version list"))
Expect(err).To(MatchError("Version Negoation packet has empty version list"))
})
})