[domistream] Tests: properties cannot pass against Unimplemented
The never-panic properties (XML, RTSP, ENet, control, input, media) and the allocation-cap checks only asserted inside `if let Ok`, so a stub returning Unimplemented for everything passed them. Each now also requires the parser to answer something other than Unimplemented (common::implemented); the XML truncation property wants Malformed or Truncated, not any error.
This commit is contained in:
@@ -393,14 +393,18 @@ proptest! {
|
||||
|
||||
#[test]
|
||||
fn message_parsers_never_panic(data in proptest::collection::vec(any::<u8>(), 0..300)) {
|
||||
if let Ok(raw) = parse_message(&data) {
|
||||
let raw = parse_message(&data);
|
||||
prop_assert!(common::implemented(&raw));
|
||||
if let Ok(raw) = raw {
|
||||
prop_assert_eq!(raw.body.len() + 4, data.len());
|
||||
}
|
||||
if let Ok(HostMessage::Other { body_len, .. }) = parse_host_message(&data) {
|
||||
let host = parse_host_message(&data);
|
||||
prop_assert!(common::implemented(&host));
|
||||
if let Ok(HostMessage::Other { body_len, .. }) = host {
|
||||
prop_assert_eq!(body_len + 4, data.len());
|
||||
}
|
||||
let _ = parse_encrypted_frame(&data);
|
||||
let _ = ControlCipher::new([3; 16]).open(Direction::HostToClient, &data);
|
||||
prop_assert!(common::implemented(&parse_encrypted_frame(&data)));
|
||||
prop_assert!(common::implemented(&ControlCipher::new([3; 16]).open(Direction::HostToClient, &data)));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user