[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:
@@ -319,7 +319,9 @@ proptest! {
|
||||
/// Arbitrary bytes: no panic; a parsed datagram re-encodes to something that parses to the same value.
|
||||
#[test]
|
||||
fn datagram_parse_is_stable(data in proptest::collection::vec(any::<u8>(), 0..512)) {
|
||||
if let Ok(d) = parse_datagram(&data) {
|
||||
let parsed = parse_datagram(&data);
|
||||
prop_assert!(common::implemented(&parsed));
|
||||
if let Ok(d) = parsed {
|
||||
prop_assert!(d.commands.len() <= MAX_COMMANDS_PER_DATAGRAM);
|
||||
prop_assert!(d.peer_id <= 0x0FFF && d.session_id < 4);
|
||||
let again = encode_datagram(&d).map_err(|e| TestCaseError::fail(format!("{e:?}")))?;
|
||||
|
||||
Reference in New Issue
Block a user