From 61513023aff4d3312287bb0fb55ea931997dfddb Mon Sep 17 00:00:00 2001 From: iximeow Date: Tue, 6 Jul 2021 16:42:24 -0700 Subject: update yaxpeax_arch and bump version to 0.1.0 --- test/armv8/a64.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'test/armv8') 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 = ::Decoder::default().decode(data.to_vec()).unwrap(); + let mut reader = yaxpeax_arch::U8Reader::new(&data[..]); + let instr = ::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 = ::Decoder::default().decode(data.to_vec()).unwrap(); + let mut reader = yaxpeax_arch::U8Reader::new(&data[..]); + let instr = ::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 = ::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 = ::Decoder::default().decode(&mut reader).unwrap(); println!( "Decoded {:02x}{:02x}{:02x}{:02x}: {}", //{:?}\n {}", INSTRUCTION_BYTES[i as usize], -- cgit v1.1