split the tracing function for received short and long header packets

This commit is contained in:
Marten Seemann 2022-08-27 15:46:37 +03:00
parent 3a12a898a5
commit ed15a94703
18 changed files with 222 additions and 89 deletions

View file

@ -181,12 +181,20 @@ var _ = Describe("Tracing", func() {
tracer.ReceivedRetry(hdr)
})
It("traces the ReceivedPacket event", func() {
It("traces the ReceivedLongHeaderPacket event", func() {
hdr := &ExtendedHeader{Header: Header{DestConnectionID: protocol.ParseConnectionID([]byte{1, 2, 3})}}
ping := &PingFrame{}
tr1.EXPECT().ReceivedPacket(hdr, ByteCount(1337), []Frame{ping})
tr2.EXPECT().ReceivedPacket(hdr, ByteCount(1337), []Frame{ping})
tracer.ReceivedPacket(hdr, 1337, []Frame{ping})
tr1.EXPECT().ReceivedLongHeaderPacket(hdr, ByteCount(1337), []Frame{ping})
tr2.EXPECT().ReceivedLongHeaderPacket(hdr, ByteCount(1337), []Frame{ping})
tracer.ReceivedLongHeaderPacket(hdr, 1337, []Frame{ping})
})
It("traces the ReceivedShortHeaderPacket event", func() {
hdr := &ShortHeader{DestConnectionID: protocol.ParseConnectionID([]byte{1, 2, 3})}
ping := &PingFrame{}
tr1.EXPECT().ReceivedShortHeaderPacket(hdr, ByteCount(1337), []Frame{ping})
tr2.EXPECT().ReceivedShortHeaderPacket(hdr, ByteCount(1337), []Frame{ping})
tracer.ReceivedShortHeaderPacket(hdr, 1337, []Frame{ping})
})
It("traces the BufferedPacket event", func() {