Cover more cases in simultaneous connect test.
@@ -152,7 +152,7 @@ fn raw_swarm_simultaneous_connect() {
Dialing,
Connected,
Replaced,
- Errored
+ Denied
}
loop {
@@ -162,7 +162,7 @@ fn raw_swarm_simultaneous_connect() {
let mut swarm1_dial_start = Delay::new(Duration::new(0, rand::random::<u32>() % 50_000_000));
let mut swarm2_dial_start = Delay::new(Duration::new(0, rand::random::<u32>() % 50_000_000));
- let future = future::poll_fn(|cx| -> Poll<bool> {
+ let future = future::poll_fn(|cx| {
loop {
let mut swarm1_not_ready = false;
let mut swarm2_not_ready = false;
@@ -202,7 +202,7 @@ fn raw_swarm_simultaneous_connect() {
error: IncomingError::DeniedLowerPriority, ..
}) => {
assert_eq!(swarm1_step, Step::Connected);
- swarm1_step = Step::Errored
+ swarm1_step = Step::Denied
}
Poll::Ready(NetworkEvent::Connected { conn_info, .. }) => {
assert_eq!(conn_info, *swarm2.local_peer_id());
@@ -233,7 +233,7 @@ fn raw_swarm_simultaneous_connect() {
error: IncomingError::DeniedLowerPriority, ..
}) => {
assert_eq!(swarm2_step, Step::Connected);
- swarm2_step = Step::Errored
+ swarm2_step = Step::Denied
}
Poll::Ready(NetworkEvent::Connected { conn_info, .. }) => {
assert_eq!(conn_info, *swarm1.local_peer_id());
@@ -260,9 +260,12 @@ fn raw_swarm_simultaneous_connect() {
match (swarm1_step, swarm2_step) {
| (Step::Connected, Step::Replaced)
- | (Step::Connected, Step::Errored)
+ | (Step::Connected, Step::Denied)
| (Step::Replaced, Step::Connected)
- | (Step::Errored, Step::Connected) => return Poll::Ready(true),
+ | (Step::Replaced, Step::Denied)
+ | (Step::Replaced, Step::Replaced)
+ | (Step::Denied, Step::Connected)
+ | (Step::Denied, Step::Replaced) => return Poll::Ready(true),
_else => ()
}
