Add invalid instr tests
@@ -514,6 +514,20 @@ fn nops_errors() {
assert!(a.notrack().nops_with_size(2000).is_err());
}
+#[test]
+fn invalid_instr_fails() {
+ let mut a = CodeAssembler::new(64).unwrap();
+ a.aaa().unwrap();
+ assert!(a.assemble(0x1234_5678_9ABC_DEF0).is_err());
+
+ let mut a = CodeAssembler::new(64).unwrap();
+ assert!(a.pop(cs).is_err());
+
+ let mut a = CodeAssembler::new(64).unwrap();
+ a.push(cs).unwrap();
+ assert!(a.assemble(0x1234_5678_9ABC_DEF0).is_err());
+}
+
#[test]
fn add_instruction() {
let mut a = CodeAssembler::new(64).unwrap();
