aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2019-03-31 04:09:55 -0700
committeriximeow <me@iximeow.net>2020-01-12 17:28:07 -0800
commit12e1073903574e78d985e7048c903680203dfb1c (patch)
tree3cc214b6c6ec84deb9b02bb6d12fdeb08a704340
parenta48bda09ce8026c86c1d8c21fa4bb0a8589e6371 (diff)
fix test breakages
-rw-r--r--test/test.rs8
1 files changed, 4 insertions, 4 deletions
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) {