diff options
author | iximeow <me@iximeow.net> | 2021-07-06 16:42:24 -0700 |
---|---|---|
committer | iximeow <me@iximeow.net> | 2021-07-06 16:43:02 -0700 |
commit | 61513023aff4d3312287bb0fb55ea931997dfddb (patch) | |
tree | 51c07a11570d5012f68929e9c44a7fc2df97b15e /test/armv8 | |
parent | c75153a5efffcd2ac5f37864182e5108ea5f70ce (diff) |
update yaxpeax_arch and bump version to 0.1.00.1.0
Diffstat (limited to 'test/armv8')
-rw-r--r-- | test/armv8/a64.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/test/armv8/a64.rs b/test/armv8/a64.rs index 90e6d6a..35a255d 100644 --- a/test/armv8/a64.rs +++ b/test/armv8/a64.rs @@ -2,7 +2,8 @@ use yaxpeax_arch::{Arch, Decoder, LengthedInstruction}; use yaxpeax_arm::armv8::a64::{ARMv8, Instruction, Operand, Opcode, SizeCode, ShiftStyle}; fn test_decode(data: [u8; 4], expected: Instruction) { - let instr = <ARMv8 as Arch>::Decoder::default().decode(data.to_vec()).unwrap(); + let mut reader = yaxpeax_arch::U8Reader::new(&data[..]); + let instr = <ARMv8 as Arch>::Decoder::default().decode(&mut reader).unwrap(); assert!( instr == expected, "decode error for {:02x}{:02x}{:02x}{:02x}:\n decoded: {:?}\n expected: {:?}\n", @@ -12,7 +13,8 @@ fn test_decode(data: [u8; 4], expected: Instruction) { } fn test_display(data: [u8; 4], expected: &'static str) { - let instr = <ARMv8 as Arch>::Decoder::default().decode(data.to_vec()).unwrap(); + let mut reader = yaxpeax_arch::U8Reader::new(&data[..]); + let instr = <ARMv8 as Arch>::Decoder::default().decode(&mut reader).unwrap(); let text = format!("{}", instr); assert!( text == expected, @@ -2313,7 +2315,8 @@ static INSTRUCTION_BYTES: [u8; 4 * 61] = [ fn test_decode_span() { let mut i = 0u64; while i < INSTRUCTION_BYTES.len() as u64 { - let instr = <ARMv8 as Arch>::Decoder::default().decode(INSTRUCTION_BYTES[(i as usize)..].iter().cloned()).unwrap(); + let mut reader = yaxpeax_arch::U8Reader::new(&INSTRUCTION_BYTES[i as usize..]); + let instr = <ARMv8 as Arch>::Decoder::default().decode(&mut reader).unwrap(); println!( "Decoded {:02x}{:02x}{:02x}{:02x}: {}", //{:?}\n {}", INSTRUCTION_BYTES[i as usize], |