improve main package test coverage

ref #241
This commit is contained in:
Lucas Clemente
2016-08-02 11:49:25 +02:00
parent 5a00fd89f6
commit 0e05534909
5 changed files with 85 additions and 11 deletions

View File

@@ -13,11 +13,6 @@ import (
"github.com/lucas-clemente/quic-go/utils"
)
var (
errFlowControlViolation = qerr.FlowControlReceivedTooMuchData
errConnectionFlowControlViolation = qerr.FlowControlReceivedTooMuchData
)
// A Stream assembles the data from StreamFrames and provides a super-convenient Read-Interface
//
// Read() and Write() may be called concurrently, but multiple calls to Read() or Write() individually must be synchronized manually.
@@ -203,10 +198,10 @@ func (s *stream) AddStreamFrame(frame *frames.StreamFrame) error {
err := s.flowControlManager.UpdateHighestReceived(s.streamID, maxOffset)
if err == flowcontrol.ErrStreamFlowControlViolation {
return errFlowControlViolation
return qerr.FlowControlReceivedTooMuchData
}
if err == flowcontrol.ErrConnectionFlowControlViolation {
return errConnectionFlowControlViolation
return qerr.FlowControlReceivedTooMuchData
}
if err != nil {
return err