Skip to content

Commit

Permalink
fix change
Browse files Browse the repository at this point in the history
  • Loading branch information
gretchenfrage committed Feb 16, 2024
1 parent f674458 commit e554eb2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
15 changes: 9 additions & 6 deletions quinn-proto/src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2760,10 +2760,13 @@ fn reject_manually() {
// The server should now reject incoming connections.
let client_ch = pair.begin_connect(client_config());
pair.drive();
let e = pair.server.assert_accept_error();
assert!(
matches!(e, crate::ConnectionError::ConnectionClosed(_)),
"wrong error"
);
assert!(pair.client.connections.get(&client_ch).unwrap().is_closed());
pair.server.assert_no_accept();
let client = pair.client.connections.get_mut(&client_ch).unwrap();
assert!(client.is_closed());
assert!(matches!(
client.poll(),
Some(Event::ConnectionLost {
reason: ConnectionError::ConnectionClosed(close)
}) if close.error_code == TransportErrorCode::CONNECTION_REFUSED
))
}
1 change: 1 addition & 0 deletions quinn-proto/src/tests/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,7 @@ impl TestEndpoint {
self.outbound
.extend(split_transmit(transmit, buf.split_to(size).freeze()));
}
self.accepted = Some(Err(e.clone()));
e
})
}
Expand Down

0 comments on commit e554eb2

Please sign in to comment.