From 12e1073903574e78d985e7048c903680203dfb1c Mon Sep 17 00:00:00 2001 From: iximeow Date: Sun, 31 Mar 2019 04:09:55 -0700 Subject: fix test breakages --- test/test.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/test.rs b/test/test.rs index 56acbb0..de70f47 100644 --- a/test/test.rs +++ b/test/test.rs @@ -10,7 +10,7 @@ use yaxpeax_arm::armv7::{ARMv7, Instruction, ConditionCode, Operands, Opcode, Sh fn test_decode(data: [u8; 4], expected: Instruction) { let mut instr = Instruction::blank(); - instr.decode_into(&data); + instr.decode_into(data.to_vec()); assert!( instr == expected, "decode error for {:02x}{:02x}{:02x}{:02x}:\n decoded: {:?}\n expected: {:?}\n", @@ -21,7 +21,7 @@ fn test_decode(data: [u8; 4], expected: Instruction) { fn test_display(data: [u8; 4], expected: &'static str) { let mut instr = Instruction::blank(); - instr.decode_into(&data); + instr.decode_into(data.to_vec()); let text = format!("{}", instr); assert!( text == expected, @@ -295,7 +295,7 @@ fn test_decode_span() { let mut i = 0u32; while i < instruction_bytes.len() as u32 { let mut instr = Instruction::blank(); - instr.decode_into(&instruction_bytes[(i as usize)..]); + instr.decode_into(instruction_bytes[(i as usize)..].iter().map(|x| *x)); println!( "Decoded {:02x}{:02x}{:02x}{:02x}: {}", //{:?}\n {}", instruction_bytes[i as usize], @@ -377,7 +377,7 @@ use test::Bencher; pub fn bench_60000_instrs(b: &mut Bencher) { b.iter(|| { for i in (0..1000) { - let mut iter = instruction_bytes.iter(); + let mut iter = instruction_bytes.iter().map(|x| *x); let mut result = Instruction::blank(); loop { match result.decode_into(&mut iter) { -- cgit v1.1