use broadcast_common::Parse;
use dvb_ci::ci_plus::cicam_player::PlayerCapabilitiesReply;
#[global_allocator]
static A: test_alloc::ProcessCounting = test_alloc::ProcessCounting::new();
#[test]
fn capabilities_reply_count_does_not_drive_allocation() {
let apdu = [0x9F, 0xA0, 0x03, 0x02, 0xFF, 0xFF];
A.reset_largest();
let r = PlayerCapabilitiesReply::parse(&apdu);
let largest = A.largest();
assert!(
matches!(&r, Err(dvb_ci::error::Error::BufferTooShort(..))),
"a count with no entries must be rejected"
);
assert!(
largest < 1024,
"largest single allocation was {largest} bytes: the wire count drove it"
);
}