chore: improve testing and increase coverage (#794)
This diff improves testing and increases coverage inside the ./internal/netxlite and ./internal/tracex packages. See https://github.com/ooni/probe/issues/2121
This commit is contained in:
parent
464d03184e
commit
d5249a6cf7
11 changed files with 621 additions and 348 deletions
|
|
@ -140,7 +140,7 @@ func (d *quicDialerQUICGo) DialContext(ctx context.Context, network string,
|
|||
pconn.Close() // we own it on failure
|
||||
return nil, err
|
||||
}
|
||||
return &quicConnectionOwnsConn{EarlyConnection: qconn, conn: pconn}, nil
|
||||
return newQUICConnectionOwnsConn(qconn, pconn), nil
|
||||
}
|
||||
|
||||
func (d *quicDialerQUICGo) dialEarlyContext(ctx context.Context,
|
||||
|
|
@ -183,6 +183,8 @@ type quicDialerHandshakeCompleter struct {
|
|||
Dialer model.QUICDialer
|
||||
}
|
||||
|
||||
var _ model.QUICDialer = &quicDialerHandshakeCompleter{}
|
||||
|
||||
// DialContext implements model.QUICDialer.DialContext.
|
||||
func (d *quicDialerHandshakeCompleter) DialContext(
|
||||
ctx context.Context, network, address string,
|
||||
|
|
@ -214,6 +216,10 @@ type quicConnectionOwnsConn struct {
|
|||
conn model.UDPLikeConn
|
||||
}
|
||||
|
||||
func newQUICConnectionOwnsConn(qconn quic.EarlyConnection, pconn model.UDPLikeConn) *quicConnectionOwnsConn {
|
||||
return &quicConnectionOwnsConn{EarlyConnection: qconn, conn: pconn}
|
||||
}
|
||||
|
||||
// CloseWithError implements quic.EarlyConnection.CloseWithError.
|
||||
func (qconn *quicConnectionOwnsConn) CloseWithError(
|
||||
code quic.ApplicationErrorCode, reason string) error {
|
||||
|
|
|
|||
Loading…
Reference in a new issue