mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-03-31 10:47:35 +03:00
Add panic test
This commit is contained in:
parent
98f5a5debc
commit
bbc1fe07d7
1 changed files with 38 additions and 0 deletions
38
u_parrot_test.go
Normal file
38
u_parrot_test.go
Normal file
|
@ -0,0 +1,38 @@
|
|||
package quic
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
tls "github.com/refraction-networking/utls"
|
||||
)
|
||||
|
||||
func testDialPanic(t *testing.T, id QUICID) {
|
||||
|
||||
quicSpec, err := QUICID2Spec(id)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
pktConn, err := net.ListenUDP("udp", nil)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
tr := &UTransport{Transport: &Transport{Conn: pktConn}, QUICSpec: &quicSpec}
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
|
||||
defer cancel()
|
||||
tr.Dial(ctx, &net.UDPAddr{IP: net.IP{127, 0, 0, 1}, Port: 1234}, &tls.Config{}, &Config{})
|
||||
|
||||
}
|
||||
|
||||
func TestDialPanic(t *testing.T) {
|
||||
|
||||
for _, s := range []QUICID{QUICChrome_115, QUICFirefox_116} {
|
||||
testDialPanic(t, s)
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue