[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:
2026-11-25 13:15:00 +01:00
parent 2740d3dd45
commit e67daea536
8 changed files with 94 additions and 112 deletions
+3 -1
View File
@@ -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:?}")))?;