This commit is contained in:
bQUARKz 2026-02-09 23:35:34 +00:00
parent 5b4b1ea58d
commit cf94ecda84
Signed by: bquarkz
SSH Key Fingerprint: SHA256:Z7dgqoglWwoK6j6u4QC87OveEq74WOhFN+gitsxtkf8

View File

@ -130,4 +130,21 @@ Operand Sizes:
assert_eq!(current_info.trim(), abi_info.trim());
}
#[test]
fn operand_size_matches_spec_for_all_opcodes() {
// Scan a generous numeric range and validate every decodable opcode.
// This ensures that abi::operand_size (if kept) never diverges from the
// canonical spec (OpcodeSpec::imm_bytes).
for raw in 0u16..=1023u16 {
if let Ok(op) = OpCode::try_from(raw) {
assert_eq!(
operand_size(op),
op.spec().imm_bytes as usize,
"operand_size must match spec for {:?}",
op
);
}
}
}
}