[domistream] Host: session test, fixes, mutation, L1 measurement, 0.2.0 #14
@@ -464,6 +464,24 @@ fn data_before_the_verify_ack_is_not_taken() {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn ping_before_the_verify_ack_is_not_acknowledged() {
|
||||
// Mutation M36: only a connected peer acknowledges a ping (PROTOCOL.md 3.1, the accepting side); before the
|
||||
// client has acknowledged the verify, an acknowledged ping must not be answered with an ACK.
|
||||
let mut h = EnetHostPeer::accept(host_config(), at(0), &connect_datagram(connect_params(3), 0)).unwrap();
|
||||
let _ = transmitted(&mut h, at(0));
|
||||
let ping = cmd(true, 0xFF, 1, CommandBody::Ping);
|
||||
h.handle_datagram(at(1), &to_host(0, Some(1), vec![ping])).unwrap();
|
||||
assert!(
|
||||
!transmitted(&mut h, at(1))
|
||||
.iter()
|
||||
.flat_map(|d| &d.commands)
|
||||
.any(|c| matches!(c.body, CommandBody::Acknowledge { .. })),
|
||||
"no acknowledgement before the verify is acknowledged"
|
||||
);
|
||||
assert_eq!(h.state(), EnetHostState::AcknowledgingConnect);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn lost_verify_is_retransmitted() {
|
||||
let mut w = wire(Impair::clean(5), Impair::clean(5), 2);
|
||||
|
||||
Reference in New Issue
Block a user