From bc3bf7337fc643b55bf7e599c1a488b999b1e73c Mon Sep 17 00:00:00 2001 From: iximeow Date: Tue, 6 Jul 2021 17:50:56 -0700 Subject: update yaxpeax-arch to 0.1.0, update impls --- test/test.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/test.rs b/test/test.rs index 431a349..0238853 100644 --- a/test/test.rs +++ b/test/test.rs @@ -1,12 +1,13 @@ extern crate yaxpeax_arch; extern crate yaxpeax_mips; -use yaxpeax_arch::{Arch, Decoder}; +use yaxpeax_arch::{Arch, Decoder, U8Reader}; use yaxpeax_mips::{MIPS, Instruction}; //, Opcode}; #[allow(dead_code)] fn test_decode(data: [u8; 4], expected: Instruction) { - let instr = ::Decoder::default().decode(data.to_vec()).unwrap(); + let mut reader = 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", @@ -16,7 +17,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 = U8Reader::new(&data[..]); + let instr = ::Decoder::default().decode(&mut reader).unwrap(); let text = format!("{}", instr); assert!( text == expected, -- cgit v1.1