aboutsummaryrefslogtreecommitdiff
path: root/test/test.rs
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2019-05-29 00:07:31 -0700
committeriximeow <me@iximeow.net>2020-01-12 16:10:13 -0800
commitaa79e826869a7fed8df6b4f7e7a7503565659f89 (patch)
tree8af668e7706ac22477cf7df67ba5cb47eaf607b3 /test/test.rs
parent09df8f120f23d733df2171b4b3e2380b6889cf3c (diff)
fix some warnings and rdtsc/swapgs decode errors
Diffstat (limited to 'test/test.rs')
-rw-r--r--test/test.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/test.rs b/test/test.rs
index f8dadbb..ebfda5a 100644
--- a/test/test.rs
+++ b/test/test.rs
@@ -4,7 +4,7 @@ extern crate yaxpeax_x86;
use std::fmt::Write;
use yaxpeax_arch::Decodable;
-use yaxpeax_x86::{Instruction, Opcode, decode_one};
+use yaxpeax_x86::{Instruction, decode_one};
fn decode(bytes: &[u8]) -> Option<Instruction> {
let mut instr = Instruction::invalid();
@@ -17,7 +17,7 @@ fn decode(bytes: &[u8]) -> Option<Instruction> {
fn test_display(data: &[u8], expected: &'static str) {
let mut hex = String::new();
for b in data {
- write!(hex, "{:02x}", b);
+ write!(hex, "{:02x}", b).unwrap();
}
match Instruction::decode(data.into_iter().map(|x| *x)) {
Some(instr) => {
@@ -60,6 +60,7 @@ fn test_arithmetic() {
}
#[test]
+#[allow(non_snake_case)]
fn test_E_decode() {
test_display(&[0xff, 0x75, 0xb8], "push [rbp - 0x48]");
test_display(&[0xff, 0x75, 0x08], "push [rbp + 0x8]");