Skip to content

Commit

Permalink
Missed a few
Browse files Browse the repository at this point in the history
  • Loading branch information
martinthomson committed Feb 7, 2024
1 parent c05adbf commit d417dd2
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions test-fixture/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,13 @@ pub const DEFAULT_ADDR_V4: SocketAddr = addr_v4();
// Create a default datagram with the given data.
#[must_use]
pub fn datagram(data: Vec<u8>) -> Datagram {
Datagram::new(addr(), addr(), IpTos::default(), Some(128), data)
Datagram::new(
DEFAULT_ADDR,
DEFAULT_ADDR,
IpTos::default(),
Some(128),
data,
)
}

/// Create a default socket address.
Expand All @@ -105,8 +111,8 @@ const fn addr() -> SocketAddr {
/// An IPv4 version of the default socket address.
#[must_use]
const fn addr_v4() -> SocketAddr {
let localhost_v4 = IpAddr::V4(Ipv4Addr::new(192, 0, 2, 1));
SocketAddr::new(localhost_v4, addr().port())
let v4ip = IpAddr::V4(Ipv4Addr::new(192, 0, 2, 1));
SocketAddr::new(v4ip, DEFAULT_ADDR.port())
}

/// This connection ID generation scheme is the worst, but it doesn't produce collisions.
Expand Down Expand Up @@ -155,8 +161,8 @@ pub fn new_client(params: ConnectionParameters) -> Connection {
DEFAULT_SERVER_NAME,
DEFAULT_ALPN,
Rc::new(RefCell::new(CountingConnectionIdGenerator::default())),
addr(),
addr(),
DEFAULT_ADDR,
DEFAULT_ADDR,
params.ack_ratio(255), // Tests work better with this set this way.
now(),
)
Expand Down Expand Up @@ -259,8 +265,8 @@ pub fn default_http3_client() -> Http3Client {
Http3Client::new(
DEFAULT_SERVER_NAME,
Rc::new(RefCell::new(CountingConnectionIdGenerator::default())),
addr(),
addr(),
DEFAULT_ADDR,
DEFAULT_ADDR,
Http3Parameters::default()
.max_table_size_encoder(100)
.max_table_size_decoder(100)
Expand All @@ -282,8 +288,8 @@ pub fn http3_client_with_params(params: Http3Parameters) -> Http3Client {
Http3Client::new(
DEFAULT_SERVER_NAME,
Rc::new(RefCell::new(CountingConnectionIdGenerator::default())),
addr(),
addr(),
DEFAULT_ADDR,
DEFAULT_ADDR,
params,
now(),
)
Expand Down

0 comments on commit d417dd2

Please sign in to comment.