[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:
@@ -280,12 +280,14 @@ proptest! {
|
||||
/// Arbitrary bytes never panic, and a parsed response respects the caps.
|
||||
#[test]
|
||||
fn response_never_panics(data in proptest::collection::vec(any::<u8>(), 0..1024)) {
|
||||
if let Ok(r) = parse_response(&data) {
|
||||
let parsed = parse_response(&data);
|
||||
prop_assert!(common::implemented(&parsed));
|
||||
if let Ok(r) = parsed {
|
||||
prop_assert!(r.headers.len() <= MAX_RTSP_HEADERS);
|
||||
prop_assert!(r.body.len() <= data.len());
|
||||
prop_assert!(r.reason.len() <= MAX_RTSP_LINE_BYTES);
|
||||
}
|
||||
let _ = parse_request(&data);
|
||||
prop_assert!(common::implemented(&parse_request(&data)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user