#![allow(
clippy::unwrap_used,
clippy::expect_used,
reason = "test code: a failing unwrap is a failing test"
)]
use urna_format::encoding::decode_payload;
const ARTIFACTS: [&[u8]; 2] = [
&[
0x01, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x4e, 0x45, 0x53, 0x03, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x1c, 0x00, 0xff, 0xff, 0x51, 0x00, 0xd0, 0x2d, 0x00, 0x15, 0x19,
],
&[
0x01, 0x00, 0x00, 0x00, 0x4e, 0x45, 0x03, 0x00, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0xff, 0xff, 0x2e, 0x00, 0x00, 0x00,
0x2e, 0x00, 0x15, 0x19,
],
];
#[test]
#[cfg_attr(miri, ignore)] fn hostile_pool_counts_are_typed_errors_not_allocation_aborts() {
for (i, payload) in ARTIFACTS.iter().enumerate() {
for enc in 0..=10u32 {
let _ = decode_payload(enc, payload);
}
assert!(!payload.is_empty(), "artifact {i} must not be empty");
}
}