forked from quic-go/quic-go
use decimal number for logging stream offsets and byte counts
This commit is contained in:
@@ -60,7 +60,7 @@ var _ = Describe("Stream Flow controller", func() {
|
||||
|
||||
Context("receiving data", func() {
|
||||
Context("registering received offsets", func() {
|
||||
var receiveWindow protocol.ByteCount = 0x10000
|
||||
var receiveWindow protocol.ByteCount = 10000
|
||||
var receiveWindowSize protocol.ByteCount = 600
|
||||
|
||||
BeforeEach(func() {
|
||||
@@ -98,7 +98,7 @@ var _ = Describe("Stream Flow controller", func() {
|
||||
})
|
||||
|
||||
It("detects a flow control violation", func() {
|
||||
Expect(controller.UpdateHighestReceived(receiveWindow+1, false)).To(MatchError("FLOW_CONTROL_ERROR: Received 0x10001 bytes on stream 10, allowed 0x10000 bytes"))
|
||||
Expect(controller.UpdateHighestReceived(receiveWindow+1, false)).To(MatchError("FLOW_CONTROL_ERROR: Received 10001 bytes on stream 10, allowed 10000 bytes"))
|
||||
})
|
||||
|
||||
It("accepts a final offset higher than the highest received", func() {
|
||||
@@ -108,8 +108,8 @@ var _ = Describe("Stream Flow controller", func() {
|
||||
})
|
||||
|
||||
It("errors when receiving a final offset smaller than the highest offset received so far", func() {
|
||||
controller.UpdateHighestReceived(0x100, false)
|
||||
Expect(controller.UpdateHighestReceived(0xff, true)).To(MatchError("FINAL_SIZE_ERROR: Received final offset 0xff for stream 10, but already received offset 0x100 before"))
|
||||
controller.UpdateHighestReceived(100, false)
|
||||
Expect(controller.UpdateHighestReceived(50, true)).To(MatchError("FINAL_SIZE_ERROR: Received final offset 50 for stream 10, but already received offset 100 before"))
|
||||
})
|
||||
|
||||
It("accepts delayed data after receiving a final offset", func() {
|
||||
@@ -118,8 +118,8 @@ var _ = Describe("Stream Flow controller", func() {
|
||||
})
|
||||
|
||||
It("errors when receiving a higher offset after receiving a final offset", func() {
|
||||
Expect(controller.UpdateHighestReceived(0x200, true)).To(Succeed())
|
||||
Expect(controller.UpdateHighestReceived(0x250, false)).To(MatchError("FINAL_SIZE_ERROR: Received offset 0x250 for stream 10. Final offset was already received at 0x200"))
|
||||
Expect(controller.UpdateHighestReceived(200, true)).To(Succeed())
|
||||
Expect(controller.UpdateHighestReceived(250, false)).To(MatchError("FINAL_SIZE_ERROR: Received offset 250 for stream 10. Final offset was already received at 200"))
|
||||
})
|
||||
|
||||
It("accepts duplicate final offsets", func() {
|
||||
@@ -129,8 +129,8 @@ var _ = Describe("Stream Flow controller", func() {
|
||||
})
|
||||
|
||||
It("errors when receiving inconsistent final offsets", func() {
|
||||
Expect(controller.UpdateHighestReceived(0x200, true)).To(Succeed())
|
||||
Expect(controller.UpdateHighestReceived(0x201, true)).To(MatchError("FINAL_SIZE_ERROR: Received inconsistent final offset for stream 10 (old: 0x200, new: 0x201 bytes)"))
|
||||
Expect(controller.UpdateHighestReceived(200, true)).To(Succeed())
|
||||
Expect(controller.UpdateHighestReceived(201, true)).To(MatchError("FINAL_SIZE_ERROR: Received inconsistent final offset for stream 10 (old: 200, new: 201 bytes)"))
|
||||
})
|
||||
|
||||
It("tells the connection flow controller when a stream is abandoned", func() {
|
||||
|
||||
Reference in New Issue
Block a user