[fuzz] rustfmt of the host targets
This commit is contained in:
@@ -30,7 +30,9 @@ fn check(req: &HostRequest) {
|
|||||||
assert_eq!(req.unique_id.as_deref(), Some(p.unique_id.as_str()), "/pair needs uniqueid");
|
assert_eq!(req.unique_id.as_deref(), Some(p.unique_id.as_str()), "/pair needs uniqueid");
|
||||||
match &p.phase {
|
match &p.phase {
|
||||||
PairPhase::GetServerCert { client_cert_pem, .. } => assert!(!client_cert_pem.is_empty()),
|
PairPhase::GetServerCert { client_cert_pem, .. } => assert!(!client_cert_pem.is_empty()),
|
||||||
PairPhase::ClientChallenge(v) | PairPhase::ServerChallengeResp(v) | PairPhase::ClientPairingSecret(v) => {
|
PairPhase::ClientChallenge(v)
|
||||||
|
| PairPhase::ServerChallengeResp(v)
|
||||||
|
| PairPhase::ClientPairingSecret(v) => {
|
||||||
assert!(!v.is_empty())
|
assert!(!v.is_empty())
|
||||||
}
|
}
|
||||||
PairPhase::PairChallenge => {}
|
PairPhase::PairChallenge => {}
|
||||||
|
|||||||
@@ -102,7 +102,10 @@ fuzz_target!(|data: &[u8]| {
|
|||||||
6 => {
|
6 => {
|
||||||
let late = now.saturating_add(Duration::from_secs(u64::from(flags)));
|
let late = now.saturating_add(Duration::from_secs(u64::from(flags)));
|
||||||
let fired = s.handle_timeout(late);
|
let fired = s.handle_timeout(late);
|
||||||
assert_eq!(fired, matches!(s.state(), HostPairingState::Failed(_)) && !matches!(before, HostPairingState::Failed(_)));
|
assert_eq!(
|
||||||
|
fired,
|
||||||
|
matches!(s.state(), HostPairingState::Failed(_)) && !matches!(before, HostPairingState::Failed(_))
|
||||||
|
);
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
@@ -136,6 +139,10 @@ fuzz_target!(|data: &[u8]| {
|
|||||||
if let HostPairingState::Failed(_) = before {
|
if let HostPairingState::Failed(_) = before {
|
||||||
assert_eq!(s.state(), before, "Failed is terminal");
|
assert_eq!(s.state(), before, "Failed is terminal");
|
||||||
}
|
}
|
||||||
assert_eq!(s.poll_timeout().is_none(), matches!(s.state(), HostPairingState::Failed(_)), "a deadline while in progress");
|
assert_eq!(
|
||||||
|
s.poll_timeout().is_none(),
|
||||||
|
matches!(s.state(), HostPairingState::Failed(_)),
|
||||||
|
"a deadline while in progress"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user